public function testReasonInactiveForRecordUpdate() { $test = new OphTrOperationbooking_ScheduleOperation_PatientUnavailable(); $test->start_date = '2014-04-03'; $test->end_date = '2014-04-03'; $test->reason_id = $this->reasons('inactive_reason')->id; // force the scenario as means we don't have to actually save anything in the db for this test $test->scenario = 'update'; $this->assertTrue($test->validate()); }