Attempt to fix test

This commit is contained in:
Pig Fang 2019-08-11 19:10:27 +08:00
parent 8b7e63d237
commit b7ee522d86

View File

@ -19,7 +19,7 @@ class PluginManagerTest extends TestCase
return $manager; return $manager;
} }
public function testPreventBootAgain() public function testPreventBootingAgain()
{ {
// TODO: modify asserting 0 times here // TODO: modify asserting 0 times here
$this->mock(Filesystem::class, function ($mock) { $this->mock(Filesystem::class, function ($mock) {
@ -29,18 +29,6 @@ class PluginManagerTest extends TestCase
app('plugins')->boot(); app('plugins')->boot();
} }
public function testRegisterAutoload()
{
$dir = config('plugins.directory');
config(['plugins.directory' => storage_path('mocks')]);
$this->assertFalse(class_exists('Fake\Faker'));
$manager = $this->rebootPluginManager(app('plugins'));
$this->assertTrue(class_exists('Fake\Faker'));
config(['plugins.directory' => $dir]);
}
public function testReportDuplicatedPlugins() public function testReportDuplicatedPlugins()
{ {
$this->mock(Filesystem::class, function ($mock) { $this->mock(Filesystem::class, function ($mock) {
@ -82,4 +70,16 @@ class PluginManagerTest extends TestCase
])); ]));
$manager = $this->rebootPluginManager(app('plugins')); $manager = $this->rebootPluginManager(app('plugins'));
} }
public function testRegisterAutoload()
{
$dir = config('plugins.directory');
config(['plugins.directory' => storage_path('mocks')]);
$this->assertFalse(class_exists('Fake\Faker'));
$manager = $this->rebootPluginManager(app('plugins'));
$this->assertTrue(class_exists('Fake\Faker'));
config(['plugins.directory' => $dir]);
}
} }