Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 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();
 }