mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-15 06:09:58 +08:00
Add test for addRoute
hook
This commit is contained in:
parent
b9c2cdff6b
commit
293668960a
@ -48,11 +48,9 @@ class Hook
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a route. A router instance will be passed to the given callback.
|
||||
* Add routes. A router instance will be passed to the given callback.
|
||||
*
|
||||
* @param Closure $callback
|
||||
*
|
||||
* TODO: Needs to be tested.
|
||||
*/
|
||||
public static function addRoute(Closure $callback)
|
||||
{
|
||||
|
@ -35,6 +35,15 @@ class HookTest extends TestCase
|
||||
->assertSee('/to/b');
|
||||
}
|
||||
|
||||
public function testAddRoute()
|
||||
{
|
||||
Hook::addRoute(function ($route) {
|
||||
$route->any('/test-hook', function () {});
|
||||
});
|
||||
event(new \App\Events\ConfigureRoutes(resolve(\Illuminate\Routing\Router::class)));
|
||||
$this->get('/test-hook')->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testRegisterPluginTransScripts()
|
||||
{
|
||||
$this->generateFakePlugin(['name' => 'fake-plugin-with-i18n', 'version' => '0.0.1']);
|
||||
|
Loading…
Reference in New Issue
Block a user