AcControllerResourceTest::testProperlyDetectNamespacesResourceControllerWithBackslashedNamespace PHP Method

testProperlyDetectNamespacesResourceControllerWithBackslashedNamespace() public method

Should properly detect namespaces for resource and controller when using '\' for namespace
    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);
    }
AcControllerResourceTest