File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 66
77abstract class AbstractTestCase extends TestCase
88{
9+ protected $ testDirectory = '' ;
10+
911 protected function createTestDirectory ()
1012 {
1113 if (!is_dir ($ this ->getTestDirectory ())) {
@@ -15,16 +17,20 @@ protected function createTestDirectory()
1517
1618 protected function getTestDirectory ()
1719 {
18- $ inheritingClassFQCN = get_class ($ this );
19- $ inheritingClassName = substr ($ inheritingClassFQCN , strrpos ($ inheritingClassFQCN , '\\' ) + 1 );
20+ if ($ this ->testDirectory === '' ) {
21+ $ inheritingClassFQCN = get_class ($ this );
22+ $ inheritingClassName = substr ($ inheritingClassFQCN , strrpos ($ inheritingClassFQCN , '\\' ) + 1 );
23+
24+ try {
25+ $ inheritingClassDirectory = dirname ((new \ReflectionClass ($ inheritingClassFQCN ))->getFileName ());
26+ } catch (\ReflectionException $ exception ) {
27+ $ inheritingClassDirectory = __DIR__ ;
28+ }
2029
21- try {
22- $ inheritingClassDirectory = dirname ((new \ReflectionClass ($ inheritingClassFQCN ))->getFileName ());
23- } catch (\ReflectionException $ exception ) {
24- $ inheritingClassDirectory = __DIR__ ;
30+ $ this ->testDirectory = $ inheritingClassDirectory .'/ ' .$ inheritingClassName ;
2531 }
2632
27- return $ inheritingClassDirectory . ' / ' . $ inheritingClassName ;
33+ return $ this -> testDirectory ;
2834 }
2935
3036 protected function removeTestDirectory ()
You can’t perform that action at this time.
0 commit comments