File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ $ composer require --dev mnapoli/phpunit-easymock
2121To be able to use EasyMock in your tests ** you must include the trait in your class** :
2222
2323``` php
24- class MyTest extends \PHPUnit_Framework_TestCase
24+ class MyTest extends \PHPUnit\Framework\TestCase
2525{
2626 use \EasyMock\EasyMock;
2727
Original file line number Diff line number Diff line change 1717 },
1818 "require" : {
1919 "php" : " ~5.4|~7.0" ,
20- "phpunit/phpunit-mock-objects" : " ~2.0|~3.0"
20+ "phpunit/phpunit-mock-objects" : " ~2.0|~3.0|~4.0 "
2121 },
2222 "require-dev" : {
23- "phpunit/phpunit" : " ~4.0 |~5.0 "
23+ "phpunit/phpunit" : " ~4.8.35 |~5.7|~6.4 "
2424 }
2525}
Original file line number Diff line number Diff line change 77use EasyMock \Test \Fixture \ClassWithConstructor ;
88use EasyMock \Test \Fixture \CustomException ;
99use EasyMock \Test \Fixture \InterfaceFixture ;
10+ use PHPUnit \Framework \TestCase ;
11+ use PHPUnit \Framework \ExpectationFailedException ;
1012
1113/**
1214 * @author Matthieu Napoli <[email protected] > 1315 */
14- class EasyMockTest extends \PHPUnit_Framework_TestCase
16+ class EasyMockTest extends TestCase
1517{
1618 use EasyMock;
1719
@@ -126,7 +128,7 @@ public function should_allow_to_spy_method_calls()
126128 ));
127129
128130 // Test PHPUnit's internals to check that the spy was registered
129- $ property = new \ReflectionProperty (' PHPUnit_Framework_TestCase ' , 'mockObjects ' );
131+ $ property = new \ReflectionProperty (TestCase::class , 'mockObjects ' );
130132 $ property ->setAccessible (true );
131133 $ mockObjects = $ property ->getValue ($ this );
132134
@@ -137,7 +139,7 @@ public function should_allow_to_spy_method_calls()
137139 try {
138140 $ mock ->__phpunit_verify ();
139141 $ this ->fail ('Exception not thrown ' );
140- } catch (\ PHPUnit_Framework_ExpectationFailedException $ e ) {
142+ } catch (ExpectationFailedException $ e ) {
141143 $ this ->assertContains ('Expected invocation at least once but it never occur ' , $ e ->getMessage ());
142144 }
143145
You can’t perform that action at this time.
0 commit comments