HI all,
I'm having trouble verifying exceptions.
/**
* @expectedException ValidationException
*/
public function test_project_should_not_save_without_expiry() {
$project = new Project();
$project->write();
}
Inside project validate function I'm checking !isset( $this->Expiry ) which stops the writing of a Project. But test results I get "Failed asserting that exception of type "ValidationException" is thrown."
The code works if I set @expectedException Exception and then throw new Exception(); inside the test.
I also tried $this->assertFalse( $project->write() ); after looking at DataObject:1065 it looks like that should work.
Any thoughts?