public function testProperlyDetectNamespacesResourceControllerWithBackslashedNamespace()
{
$commentAttributes = ['id' => 3];
$comment = $this->buildModel('App\\Comment', $commentAttributes);
$this->params = array_merge($this->params, ['controller' => 'CommentsController', 'action' => 'show', 'id' => $comment->id]);
$this->mock('App\\Http\\Controllers\\CommentsController');
$controller = app('App\\Http\\Controllers\\CommentsController');
$controller->shouldReceive('getParams')->andReturnUsing(function () {
return $this->params;
});
$controller->shouldReceive('getCurrentAuthority')->andReturnUsing(function () {
return $this->authority;
});
$resource = new Efficiently\AuthorityController\ControllerResource($controller);
$resource->loadResource();
$this->assertEquals($this->getProperty($controller, 'comment'), $comment);
}