Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c1916d8

Browse filesBrowse files
committed
finished previous commit
1 parent 953a383 commit c1916d8
Copy full SHA for c1916d8

File tree

2 files changed

+6
-22
lines changed
Filter options

2 files changed

+6
-22
lines changed

‎src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/FormFieldRegistry.php
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class FormFieldRegistry
2626
* Adds a field to the registry.
2727
*
2828
* @param FormField $field The field
29-
*
30-
* @throws \InvalidArgumentException when the name is malformed
3129
*/
3230
public function add(FormField $field)
3331
{
@@ -52,8 +50,6 @@ public function add(FormField $field)
5250
* Removes a field and its children from the registry.
5351
*
5452
* @param string $name The fully qualified name of the base field
55-
*
56-
* @throws \InvalidArgumentException when the name is malformed
5753
*/
5854
public function remove($name)
5955
{
@@ -76,7 +72,6 @@ public function remove($name)
7672
*
7773
* @return mixed The value of the field
7874
*
79-
* @throws \InvalidArgumentException when the name is malformed
8075
* @throws \InvalidArgumentException if the field does not exist
8176
*/
8277
public function &get($name)
@@ -118,7 +113,6 @@ public function has($name)
118113
* @param string $name The fully qualified name of the field
119114
* @param mixed $value The value
120115
*
121-
* @throws \InvalidArgumentException when the name is malformed
122116
* @throws \InvalidArgumentException if the field does not exist
123117
*/
124118
public function set($name, $value)
@@ -199,8 +193,6 @@ private function walk(array $array, $base = '', array &$output = array())
199193
* @param string $name The name of the field
200194
*
201195
* @return string[] The list of segments
202-
*
203-
* @throws \InvalidArgumentException when the name is malformed
204196
*/
205197
private function getSegments($name)
206198
{
@@ -218,6 +210,6 @@ private function getSegments($name)
218210
return $segments;
219211
}
220212

221-
return [$name];
213+
return array($name);
222214
}
223215
}

‎src/Symfony/Component/DomCrawler/Tests/FormTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Tests/FormTest.php
+5-13Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -681,22 +681,14 @@ public function testTypeAttributeIsCaseInsensitive()
681681
$this->assertTrue($form->has('example.y'), '->has() returns true if the image input was correctly turned into an x and a y fields');
682682
}
683683

684-
/**
685-
* @expectedException \InvalidArgumentException
686-
*/
687-
public function testFormFieldRegistryAddThrowAnExceptionWhenTheNameIsMalformed()
684+
public function testFormFieldRegistryAcceptAnyNames()
688685
{
689-
$registry = new FormFieldRegistry();
690-
$registry->add($this->getFormFieldMock('[foo]'));
691-
}
686+
$field = $this->getFormFieldMock('[t:dbt%3adate;]data_daterange_enddate_value');
692687

693-
/**
694-
* @expectedException \InvalidArgumentException
695-
*/
696-
public function testFormFieldRegistryRemoveThrowAnExceptionWhenTheNameIsMalformed()
697-
{
698688
$registry = new FormFieldRegistry();
699-
$registry->remove('[foo]');
689+
$registry->add($field);
690+
$this->assertEquals($field, $registry->get('[t:dbt%3adate;]data_daterange_enddate_value'));
691+
$registry->remove('[t:dbt%3adate;]data_daterange_enddate_value');
700692
}
701693

702694
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.