This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,7 @@ final public function testShimShouldBeInstantiatedWhenGivenTestCase()
6161 $ calledClass = get_called_class ();
6262 $ calledClass = substr ($ calledClass , 0 , -4 ); // 4 = strlen('Test')
6363
64- $ mockName = class_exists ('\PHPUnit_Framework_TestCase ' )
65- ? '\PHPUnit_Framework_TestCase '
66- : '\PHPUnit\Framework\TestCase '
67- ;
68-
69- $ mockTestCase = $ this ->getMockBuilder ($ mockName )->disableOriginalConstructor ()->getMockForAbstractClass ();
64+ $ mockTestCase = $ this ->getMockTestCase ();
7065
7166 $ shim = new $ calledClass ($ mockTestCase );
7267
@@ -149,6 +144,22 @@ final public function testShim_Should_When_GetExistingClassName()
149144 {
150145 $ this ->markTestIncomplete ('@TODO: Write tests for \Potherca\PhpUnit\Shim\AbstractTraitShim::getExistingClassName() ' );
151146 }
147+
148+ ////////////////////////////// MOCKS AND STUBS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\
149+
150+ /**
151+ * @return mixed
152+ */
153+ final public function getMockTestCase ()
154+ {
155+ $ mockName = class_exists ('\PHPUnit_Framework_TestCase ' )
156+ ? '\PHPUnit_Framework_TestCase '
157+ : '\PHPUnit\Framework\TestCase ' ;
158+
159+ $ mockTestCase = $ this ->getMockBuilder ($ mockName )->disableOriginalConstructor ()->getMockForAbstractClass ();
160+
161+ return $ mockTestCase ;
162+ }
152163}
153164
154165/*EOF*/
You can’t perform that action at this time.
0 commit comments