scratch – Blame information for rev 87
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
87 | office | 1 | <?php |
2 | |||
3 | /* |
||
4 | * This file is part of the Symfony package. |
||
5 | * |
||
6 | * (c) Fabien Potencier <fabien@symfony.com> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Symfony\Component\DomCrawler\Tests\Field; |
||
13 | |||
14 | use Symfony\Component\DomCrawler\Field\InputFormField; |
||
15 | |||
16 | class FormFieldTest extends FormFieldTestCase |
||
17 | { |
||
18 | public function testGetName() |
||
19 | { |
||
20 | $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); |
||
21 | $field = new InputFormField($node); |
||
22 | |||
23 | $this->assertEquals('name', $field->getName(), '->getName() returns the name of the field'); |
||
24 | } |
||
25 | |||
26 | public function testGetSetHasValue() |
||
27 | { |
||
28 | $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); |
||
29 | $field = new InputFormField($node); |
||
30 | |||
31 | $this->assertEquals('value', $field->getValue(), '->getValue() returns the value of the field'); |
||
32 | |||
33 | $field->setValue('foo'); |
||
34 | $this->assertEquals('foo', $field->getValue(), '->setValue() sets the value of the field'); |
||
35 | |||
36 | $this->assertTrue($field->hasValue(), '->hasValue() always returns true'); |
||
37 | } |
||
38 | } |