AcControllerResourceTest::testShouldAuthorizeNestedResourceThroughParentAssociationOnIndexAction PHP Метод

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

Should authorize nested resource through parent association on index action
    public function testShouldAuthorizeNestedResourceThroughParentAssociationOnIndexAction()
    {
        $this->params = array_merge($this->params, array_merge(['action' => 'index']));
        $category = $this->mock('Category');
        $this->setProperty($this->controller, 'category', $category);
        $this->controller->shouldReceive('authorize')->once()->with('index', ['Project' => $category])->once()->andThrow("Efficiently\\AuthorityController\\Exceptions\\AccessDenied");
        $resource = new Efficiently\AuthorityController\ControllerResource($this->controller, ['through' => 'category']);
        $this->setExpectedException("Efficiently\\AuthorityController\\Exceptions\\AccessDenied");
        $resource->authorizeResource();
    }
AcControllerResourceTest