thekid/rfc — Issue #199: RFC 0199: Assertions
Author: thekid
Created: 2011-10-09 15:45:22+00:00
State: open

Scope of Change
====
A new API for assertions will be added: `Assert::that()`.

Rationale
====
More verbose error messages for the failure case.

Functionality
====
Instead of using the `unittest.TestCase` class' methods such as
`assertEquals()` and friends the static `Assert::that()`
method is used in conjunction with constraint objects:

API
----

```php

```

Examples
----

```php
and->endWith('o'));
Assert::that($name, Should::match('/[a-z]/i'));
Assert::that(NULL, Should::be()->null);
Assert::that($class->getMethods(), Should::not()->be->empty);
Assert::that($expr, Should::neither()->equal(2)->nor->be->lessThan(0));
?>
```

Security considerations
====
None

Speed impact
====
None, optional API

Dependencies
====
None

Related documents
====
Flexible JUnit assertions with assertThat()
* http://joe.truemesh.com/blog/000511.html

Overlay:
* http://xp-framework.net/rfc/contrib/rfc0199.xar

JMock constraints:
* http://jmock.org/docs/javadoc/org/jmock/core/Constraint.html

NUnit 2.4 Assert Syntax - the Latest Developments
* http://nunit.net/blogs/?p=44

Comments
====