public function testDetachingBehaviors() { $behavior = new NewBehavior(); $this->component->attachBehavior('newBehavior', $behavior); $this->component->detachBehaviors(); try { $this->component->test(); } catch (Exception $e) { $this->assertInstanceOf('CException', $e); $this->assertSame('NewComponent and its behaviors do not have a method or closure named "test".', $e->getMessage()); } }
public function testDetachingBehaviors() { $component = new NewComponent(); $behavior = new NewBehavior(); $component->attachBehavior('a', $behavior); $component->detachBehaviors(); $this->setExpectedException('CException'); $component->test(); }