public function testEnablingBehaviors() { $behavior = new NewBehavior(); $this->component->attachBehavior('newBehavior', $behavior); $this->component->disableBehaviors(); $this->assertFalse($behavior->getEnabled()); $this->component->enableBehaviors(); $this->assertTrue($behavior->getEnabled()); }
public function testDisableBehaviors() { $component = new NewComponent(); $component->attachBehavior('a', new NewBehavior()); $component->disableBehaviors(); $this->setExpectedException('CException'); // test should not be called since behavior is disabled echo $component->test(); }