/** * Test remove control for new instances with cloning. */ public function testRemoveControlNewInstanceAfterClone() { $class1 = new SimpleClass(); $class2 = new SimpleClass(); RC::getNewInstance(self::SIMPLE_CLASS_NAME)->get('method')->setValue(new Value(__FUNCTION__)); $this->assertSame(__FUNCTION__, $class1->method()); RC::removeNewInstance(self::SIMPLE_CLASS_NAME); $this->assertSame(self::SIMPLE_CLASS_NAME . '::method', $class2->method()); }
/** * Test default behavior of synthetic class. */ public function testDefaultClassBehavior() { $class = new SimpleClass(); $this->assertSame(self::SIMPLE_CLASS_NAME . '::method', $class->method()); $this->assertSame(self::SIMPLE_CLASS_NAME . '::staticMethod', $class->staticMethod()); $this->assertFalse(RC::hasObject($class, 'method')); $this->assertFalse(RC::hasStatic(self::SIMPLE_CLASS_NAME, 'staticMethod')); }