Beispiel #1
0
 /** @test */
 public function it_generates_urls_to_model()
 {
     $this->shouldReceiveAnyOther();
     $this->instance->registerRoutes();
     $methods = ['table', 'create', 'store', 'edit', 'update', 'destroy', 'moveup', 'movedown'];
     foreach ($methods as $method) {
         $this->urlGenerator->shouldReceive('route')->with('test-prefix.table.' . $method, ['TestModel'])->once()->andReturn('some-route');
         $methodName = 'routeTo' . ucfirst($method);
         $route = $this->instance->{$methodName}('TestModel');
         $this->assertEquals('some-route', $route);
     }
 }
Beispiel #2
0
 /**
  * Register all admin routes
  *
  * @static 
  */
 public static function registerRoutes()
 {
     return \SleepingOwl\Admin\Router::registerRoutes();
 }