-
-
Save davemfletcher/5200321 to your computer and use it in GitHub Desktop.
Revisions
-
JeffreyWay revised this gist
Mar 19, 2013 . 1 changed file with 4 additions and 0 deletions.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 @@ -1,3 +1,7 @@ <?php // ... public function testProtected() { $dateFormatter = new DateFormatter; -
JeffreyWay revised this gist
Mar 19, 2013 . 1 changed file with 3 additions and 4 deletions.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 @@ -4,14 +4,13 @@ public function testProtected() $class = new \ReflectionClass('DateFormatter'); // Find the protected/private method and make it public $getSentence = $class->getMethod('getSentence'); $getSentence->setAccessible(true); // Trigger the method, and pass in any applicable args $sentence = $getSentence->invokeArgs($dateFormatter, [1, 'month']); // Do your test as usual $this->assertEquals('1 month from now.', $sentence); } -
JeffreyWay created this gist
Mar 19, 2013 .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,17 @@ public function testProtected() { $dateFormatter = new DateFormatter; $class = new \ReflectionClass('DateFormatter'); // Find the protected/private method and make it public $getSentence = $class->getMethod('getSentence'); $getSentence->setAccessible(true); // Trigger the method, and pass in any applicable args $sentence = $getSentence->invokeArgs($dateFormatter, [1, 'month']); // Do your test as usual $this->assertEquals('1 month from now.', $sentence); // getDocComment }