/** * Test control static methods with specify class name. */ public function testControlStaticClassName() { RC::getStatic(self::SIMPLE_CLASS_NAME)->get('staticMethod')->setValue(new Value(__CLASS__)); $this->assertSame(__CLASS__, SimpleClass::staticMethod()); RC::getStatic('\\' . self::SIMPLE_CLASS_NAME)->get('staticMethod')->setValue(new Value(__FUNCTION__)); $this->assertSame(__FUNCTION__, SimpleClass::staticMethod()); }
/** * 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')); }