Opis\Colibri\Test\ClosureTest::testClosureBindToObjectScope PHP Method

testClosureBindToObjectScope() public method

    public function testClosureBindToObjectScope()
    {
        $a = new A();
        $b = function () {
            return $this->aProtected();
        };
        $b = $b->bindTo($a, __NAMESPACE__ . "\\A");
        $u = $this->s($b);
        $this->assertEquals('protected called', $u());
    }