Last active
August 29, 2015 14:20
-
-
Save kdambekalns/6fd1e3b924c07acb5a2d to your computer and use it in GitHub Desktop.
Revisions
-
kdambekalns revised this gist
May 11, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,6 @@ public function invalidFooIdentifiers() { */ public function invalidFooIdentifierDoesSomething(\Closure $invalidFooIdentifierClosure) { $invalidAppIdentifier = $invalidAppIdentifierClosure->bindTo($this)->__invoke(); // ... } } -
kdambekalns created this gist
May 11, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ PHPUnit collects the data from a dataProvider early during test execution, so the PersistenceManager instance is NULL, if used directly in the provider. Returning a closure that is re-bound during the the test makes this work. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?php /** * Testcase for FooController */ class FooControllerTest extends \TYPO3\Flow\Tests\FunctionalTestCase { /** * @return array */ public function invalidFooIdentifiers() { return array( array(function() {return 'abcdef123456';}), array(function() {return $this->persistenceManager->getIdentifierByObject($this->foo);}), ); } /** * @test * @dataProvider invalidFooIdentifiers */ public function invalidFooIdentifierDoesSomething(\Closure $invalidFooIdentifierClosure) { $invalidAppIdentifier = $invalidAppIdentifierClosure->bindTo($this)->__invoke(); // ... }