File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 55use Carbon \Carbon ;
66use Illuminate \Support \Facades \Config ;
77use org \bovigo \vfs \vfsStream ;
8+ use org \bovigo \vfs \vfsStreamFile ;
89use RonasIT \Support \Exceptions \ClassNotExistsException ;
910use RonasIT \Support \Tests \Support \Command \CommandMockTrait ;
1011use UnexpectedValueException ;
@@ -13,6 +14,18 @@ class CommandTest extends TestCase
1314{
1415 use CommandMockTrait;
1516
17+ public function setUp (): void
18+ {
19+ parent ::setUp ();
20+
21+ vfsStream::newDirectory ('config ' )->at ($ this ->rootDirectory );
22+ $ routesDir = vfsStream::newDirectory ('routes ' )->at ($ this ->rootDirectory );
23+
24+ $ apiRoute = new vfsStreamFile ('api.php ' );
25+
26+ $ routesDir ->addChild ($ apiRoute );
27+ }
28+
1629 public function testCallWithInvalidCrudOption ()
1730 {
1831 $ this ->assertExceptionThrew (
Original file line number Diff line number Diff line change 99use Illuminate \Support \Str ;
1010use Orchestra \Testbench \TestCase as BaseTestCase ;
1111use org \bovigo \vfs \vfsStream ;
12+ use org \bovigo \vfs \vfsStreamDirectory ;
1213use RonasIT \Support \EntityGeneratorServiceProvider ;
1314use RonasIT \Support \Traits \FixturesTrait ;
1415use org \bovigo \vfs \vfsStreamFile ;
@@ -21,24 +22,19 @@ class TestCase extends BaseTestCase
2122 protected bool $ globalExportMode = false ;
2223 protected string $ generatedFileBasePath ;
2324
25+ protected vfsStreamDirectory $ rootDirectory ;
26+
2427 public function setUp (): void
2528 {
2629 parent ::setUp ();
2730
2831 $ this ->mockConfigurations ();
2932
30- $ root = vfsStream::setup ();
31-
32- vfsStream::newDirectory ('config ' )->at ($ root );
33- $ routesDir = vfsStream::newDirectory ('routes ' )->at ($ root );
34-
35- $ apiRoute = new vfsStreamFile ('api.php ' );
36-
37- $ routesDir ->addChild ($ apiRoute );
38-
39- Event::fake ();
33+ $ this ->rootDirectory = vfsStream::setup ();
4034
4135 $ this ->generatedFileBasePath = vfsStream::url ('root ' );
36+
37+ Event::fake ();
4238
4339 $ this ->app ->setBasePath ($ this ->generatedFileBasePath );
4440 }
You can’t perform that action at this time.
0 commit comments