I have a validation method that looks like this:
$row = $this->GetRowFromUserTable($id);
$this->assertLessThan(time(), time($row['last_update']));
When $ row is null, access to $ row ['last_update'] should start E_NOTICE, and this test should fail, but it is not.
This code crashes on the first statement, so I know that $ row is null (the binding is the same):
$row = $this->GetRowFromUserTable($id);
$this->assertNotNull($row);
$this->assertLessThan(time(), time($row['last_update']));
When I write this:
$row = $this->GetRowFromUserTable($id);
$this->assertEquals(E_ALL, error_reporting());
$this->assertLessThan(time(), time($row['last_update']));
it succeeds, so I'm also sure that error_reporting is right, and this situation should have something to do with PHPUnit.
I am using PHPUnit 3.5.6
I read this question:
Can I get PHPUnit to crash if the code issues a notification? but the answer is to use a newer version of PHPUnit, but this answer is from 2009, so this is not it.
: IDE 6.9.1 NetBeans .