Inject current plugin at bootstrapper
This commit is contained in:
parent
602fde7227
commit
ca4d1b5d04
@ -230,7 +230,7 @@ class PluginManager
|
|||||||
{
|
{
|
||||||
$path = $plugin->getPath().'/bootstrap.php';
|
$path = $plugin->getPath().'/bootstrap.php';
|
||||||
if ($this->filesystem->exists($path)) {
|
if ($this->filesystem->exists($path)) {
|
||||||
$this->app->call($this->filesystem->getRequire($path));
|
$this->app->call($this->filesystem->getRequire($path), ['plugin' => $plugin]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +291,9 @@ class PluginManagerTest extends TestCase
|
|||||||
$mock->shouldReceive('getRequire')
|
$mock->shouldReceive('getRequire')
|
||||||
->with('/mayaka/bootstrap.php')
|
->with('/mayaka/bootstrap.php')
|
||||||
->once()
|
->once()
|
||||||
->andReturn(function (\Illuminate\Contracts\Events\Dispatcher $events) {
|
->andReturn(function (\Illuminate\Contracts\Events\Dispatcher $events, Plugin $plugin) {
|
||||||
$this->assertTrue(method_exists($events, 'listen'));
|
$this->assertTrue(method_exists($events, 'listen'));
|
||||||
|
$this->assertEquals('mayaka', $plugin->name);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user