thekid/rfc — Issue #187: RFC 0187: @expect withMessage
Author: thekid
Created: 2011-10-09 15:40:36+00:00
State: open
Labels: rfc

Scope of Change
====
The `@expect` annotation will be enhanced to provide a means for
also checking the expected exception's message.

Rationale
====
Ensuring a certain exception message requires the "old-style" approach
with `try`, `fail();` and the checking the message inside
`catch (ExpectedException $expected)`, a construct we successfully
removed the need for with `@expect` years ago.

Functionality
====

The `@expect` annotation is currently written as:

```
@expect([CLASSNAME])

```
Keeping the old syntax intact, the new form is defined as:

```
@expect(class= [CLASSNAME], withMessage= [MESSAGE])

```

This test succeeds:

```php

```

This test fails:

```php

```

Security considerations
====
n/a

Speed impact
====
Negligible

Dependencies
====
n/a

Related documents
====
* http://code.google.com/p/instinct/wiki/Specifications
* xp-framework/rfc #32 - the original @expect RFC
* http://xp-framework.net/rfc/contrib/rfc0187.diff

Comments
====