Skip to content

Commit 20749e4

Browse files
committed
Merge pull request #1 from NitroXy/pr_test
test hidden
2 parents 4df6d8f + eb45f72 commit 20749e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/FieldTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use NitroXy\PHPForms\Form;
4+
5+
require_once 'MockForm.php';
6+
7+
class FieldTest extends PHPUnit_Framework_TestCase {
8+
public function testHiddenField(){
9+
$mock = new MockLayout();
10+
$form = Form::create('id', function($f){
11+
$f->hidden_field('foo', '1');
12+
}, ['layout' => $mock]);
13+
$this->assertArrayHasKey('foo', $mock->field);
14+
$this->assertEquals('hidden', $mock->field['foo']->attribute('type'));
15+
$this->assertEquals('1', $mock->field['foo']->attribute('value'));
16+
}
17+
}

0 commit comments

Comments
 (0)