AcControllerResourceTest::testShouldOnlyAuthorizeShowActionOnParentResource PHP Метод

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

Should only authorize 'show' action on parent resource
    public function testShouldOnlyAuthorizeShowActionOnParentResource()
    {
        $projectAttributes = ['id' => 2];
        $project = $this->buildModel('Project', $projectAttributes);
        $this->params = array_merge($this->params, array_merge(['action' => 'create', 'project_id' => $project->id]));
        $this->controller->shouldReceive('authorize')->with('show', $project)->once()->andThrow('Efficiently\\AuthorityController\\Exceptions\\AccessDenied');
        $resource = new Efficiently\AuthorityController\ControllerResource($this->controller, 'project', ['parent' => true]);
        $this->setExpectedException("Efficiently\\AuthorityController\\Exceptions\\AccessDenied");
        $resource->loadAndAuthorizeResource();
    }
AcControllerResourceTest