xp-framework/rfc — Issue #145: Make unittests strict
Author: kiesel
Created: 2011-10-17 16:00:29+00:00
State: closed
Labels: framework, implemented

Scope of Change
====
A new check will be introduced to the unittest.TestCase class that will assert
that no PHP notices have been produced while running a test.

Rationale
====
PHP notices often indicate some kind of defect in a software which is
not critical at first glance but can have a hidden impact whose source
then is hard to spot.
A recent test-run revealed some (real) bugs in XP core packages that went
unnoticed until now and which were found by checking the error stack.

Functionality
====
A new check will be performed after each test method run.

Note
----

```
Checks on the error registry are only performed when a test case does not
throw an exception.

```

Consider this:

```php

```

* exif_read_data() will return FALSE which is checked and an exception
is thrown. A unittest will test for this behaviour using @expect e.g.
* exif_read_data() will also emit a warning explaining *why* it couldn't
read the EXIF data.
* This warning contains useful information, so it shouldn't be deleted
in the above example.

Security considerations
====
n/a

Speed impact
====
n/a

Dependencies
====
n/a

Related documents
====
- http://xp-framework.net/rfc/contrib/rfc0145.diff
Implementing patch