function testStaticSettingOnInstances() { $instance1 = new ObjectTest_MyObject(); $instance2 = new ObjectTest_MyObject(); $instance1->set_stat('mystaticProperty', 'changed'); $this->assertEquals($instance2->stat('mystaticProperty'), 'changed', 'Statics setting through set_stat() is populated throughout instances without explicitly clearing cache'); }
public function testIsA() { $this->assertTrue(ObjectTest_MyObject::create() instanceof Object); $this->assertTrue(ObjectTest_MyObject::create() instanceof ObjectTest_MyObject); }
function testStaticSettingOnInstances() { static $_SINGLETONS; $_SINGLETONS = null; $instance1 = new ObjectTest_MyObject(); $instance2 = new ObjectTest_MyObject(); $instance1->set_stat('mystaticProperty', 'changed'); $this->assertEquals( $instance2->stat('mystaticProperty'), 'changed', 'Statics setting through set_stat() is populated throughout instances without explicitly clearing cache' ); /* $this->assertEquals( ObjectTest_MyObject::$mystaticProperty, 'changed', 'Statics setting through set_stat() reflects on PHP built-in statics on the class' ); */ }