testbench: Unable to fully swap base path on Laravel 5

Hello, I’m trying to run my tests, that are creating a folder. I use the following to define the wanted path:

$this->testModulePath = __DIR__ . "/../Modules/{$this->testModuleName}";

When I dump this using dd I get : "/Users/nicolaswidart/Sites/Asguard/IndividualModules/Workshop/Tests/../Modules/TestingTestModule", which is correct.

Though when calling an artisan command that is suppose to generate it, it makes it under vendor/orchestra/testbench/fixtures/Modules/TestingTestModule

This is my getEnvironmentSetUp method:

protected function getEnvironmentSetUp($app)
{
    $app['path.base'] = __DIR__ . '/..';
}

Did I miss something ?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 25 (14 by maintainers)

Most upvoted comments

Testing this isn’t possible then in laravel 5, great. 😦

Already suggested the possible option, you just choose not to follow it.

  • Use the available fixtures folder. We provide it for that exact reason, and clean up once the test is executed.
  • Create your own fixtures folder, a complete replicate of fixture folder in Testbench repository.

Ok then … thanks I guess.

Testing this isn’t possible then in laravel 5, great. 😦