AcControllerResourceTest::testProperlyDetectRootNamespaceResourceNamespacedControllerWithBackslashedNamespace PHP Метод

testProperlyDetectRootNamespaceResourceNamespacedControllerWithBackslashedNamespace() публичный Метод

Should properly detect root namespace of resource for namespaced controller when using '\' for namespace
    public function testProperlyDetectRootNamespaceResourceNamespacedControllerWithBackslashedNamespace()
    {
        $commentAttributes = ['id' => 3];
        $comment = $this->buildModel('App\\Comment', $commentAttributes);
        $this->params = array_merge($this->params, ['controller' => 'App\\Http\\Controllers\\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