public 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');
 }
Exemplo n.º 2
0
	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'
		);
		*/
	}