/** * test that model->hasMethod checks self and behaviors. * * @return void */ public function testHasMethod() { $Boat = new Boat(); $Boat->Behaviors = $this->getMock('BehaviorCollection'); $Boat->Behaviors->expects($this->at(0))->method('hasMethod')->will($this->returnValue(true)); $Boat->Behaviors->expects($this->at(1))->method('hasMethod')->will($this->returnValue(false)); $this->assertTrue($Boat->hasMethod('find')); $this->assertTrue($Boat->hasMethod('pass')); $this->assertFalse($Boat->hasMethod('fail')); }