8000 [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't by nykopol · Pull Request #18732 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't #18732

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

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add test to prevent future regression
  • Loading branch information
nykopol committed May 10, 2016
commit 068bc66d7126f702971d5052702076132cba6539
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,15 @@ public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()

$this->assertFalse($this->propertyAccessor->isWritable($car, 'axes', $axes));
}

/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
* expectedExceptionMessageRegExp /The property "axes" in class "Mock_PropertyAccessorCollectionTest_Car[^"]*" can be defined with the methods "addAxis()" and "removeAxis()" but the new value must be an array or an instance of \Traversable, "string" given./
*/
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable()
{
$car = $this->getMock(__CLASS__.'_Car');

$this->propertyAccessor->setValue($car, 'axes', 'Not an array or Traversable');
}
}
0