AcControllerResourceTest::testShouldLoadCollectionResourceWhenDefiningAuthorityRulesThroughClosure PHP Метод

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

Should not use load collection when defining Authority rules through a Closure
    public function testShouldLoadCollectionResourceWhenDefiningAuthorityRulesThroughClosure()
    {
        $project = $this->mock('Project');
        $project->shouldReceive('get')->never()->andReturn("found_projects");
        $this->params['action'] = "index";
        $this->authority->allow('read', 'Project', function ($self, $p) {
            return false;
        });
        $resource = new Efficiently\AuthorityController\ControllerResource($this->controller);
        $resource->loadResource();
        $this->assertNull($this->getProperty($this->controller, 'project'));
        $this->assertFalse(property_exists($this->controller, 'projects'));
    }
AcControllerResourceTest