mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-03-07 15:16:40 +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
|
* @param Closure $callback
|
||||||
*
|
|
||||||
* TODO: Needs to be tested.
|
|
||||||
*/
|
*/
|
||||||
public static function addRoute(Closure $callback)
|
public static function addRoute(Closure $callback)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,15 @@ class HookTest extends TestCase
|
|||||||
->assertSee('/to/b');
|
->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()
|
public function testRegisterPluginTransScripts()
|
||||||
{
|
{
|
||||||
$this->generateFakePlugin(['name' => 'fake-plugin-with-i18n', 'version' => '0.0.1']);
|
$this->generateFakePlugin(['name' => 'fake-plugin-with-i18n', 'version' => '0.0.1']);
|
||||||
|
Loading…
Reference in New Issue
Block a user