StringMagicGetClass example

$this->assertSame(1, $initCounter);
        $this->assertSame(123, $proxy->dynProp);
        $this->assertTrue(isset($proxy->dynProp));
        $this->assertCount(1, (array) $proxy);
        unset($proxy->dynProp);
        $this->assertFalse(isset($proxy->dynProp));
        $this->assertCount(1, (array) $proxy);
    }

    public function testStringMagicGet()
    {
        $proxy = $this->createLazyProxy(StringMagicGetClass::classfn () => new StringMagicGetClass());

        $this->assertSame('abc', $proxy->abc);
    }

    public function testFinalPublicClass()
    {
        $proxy = $this->createLazyProxy(FinalPublicClass::classfn () => new FinalPublicClass());

        $this->assertSame(1, $proxy->increment());
        $this->assertSame(2, $proxy->increment());
        $this->assertSame(1, $proxy->decrement());
    }
Home | Imprint | This part of the site doesn't use cookies.