8000 [Form] Disabled manual singulars in PropertyPath until the syntax is finalized by webmozart · Pull Request #5011 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Disabled manual singulars in PropertyPath until the syntax is finalized #5011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Form] Disabled manual singulars in PropertyPath until the syntax is …
…finalized
  • Loading branch information
webmozart committed Jul 22, 2012
commit dd2aa54e15d3f31aa9f959afe8e141f3a09fabe7
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ public function testSetValueCallsAdderAndRemoverForNestedCollections()

public function testSetValueCallsCustomAdderAndRemover()
{
$this->markTestSkipped('This feature is temporarily disabled as of 2.1');

$car = $this->getMock(__CLASS__ . '_CarCustomSingular');
$axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth'));
$axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third'));
Expand Down Expand Up @@ -300,6 +302,9 @@ public function noAdderRemoverData()
);
$data[] = array($car, $propertyPath, $expectedMessage);

/*
Temporarily disabled in 2.1

$propertyPath = new PropertyPath('axes|boo');
$expectedMessage = sprintf(
'Neither element "axes" nor method "setAxes()" exists in class '
Expand All @@ -309,6 +314,7 @@ public function noAdderRemoverData()
'boo'
);
$data[] = array($car, $propertyPath, $expectedMessage);
*/

$car = $this->getMock(__CLASS__ . '_CarNoAdderAndRemoverWithProperty');
$propertyPath = new PropertyPath('axes');
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function testGetValueReadsProperty()

public function testGetValueIgnoresSingular()
{
$this->markTestSkipped('This feature is temporarily disabled as of 2.1');

$object = (object) array('children' => 'Many');

$path = new PropertyPath('children|child');
Expand Down
5 changes: 3 additions & 2 deletions src/Symfony/Component/Form/Util/PropertyPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ public function __construct($propertyPath)
$element = $matches[3];
$this->isIndex[] = true;
}

$pos = strpos($element, self::SINGULAR_SEPARATOR);
// Disabled this behaviour as the syntax is not yet final
//$pos = strpos($element, self::SINGULAR_SEPARATOR);
$pos = false;
$singular = null;

if (false !== $pos) {
Expand Down
0