AcControllerResourceTest::testShouldCallClosureWhenAnInstanceVariableIsPassed PHP Метод

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

Should call Closure when an instance variable is passed
    public function testShouldCallClosureWhenAnInstanceVariableIsPassed()
    {
        $blockCalled = false;
        $this->authority->allow('preview', 'all', function ($self, $object) use(&$blockCalled) {
            $this->assertInstanceOf('stdClass', $object);
            return $blockCalled = true;
        });
        $this->assertTrue($this->authority->can('preview', new stdClass()));
        $this->assertTrue($blockCalled);
    }
AcControllerResourceTest