at 2010-09-18
in Unittests
by friebe
(0 comments)
The unittest API has been extended to support regular expression matching on expected exception messages. To make use of this feature, use a forward slash ("/") as the first character in @expect(withMessage). Here's an example:
public function callNonExistantMethod() { $this->remote->lookup('xp/test/Calculator')->doesNotExist(); }The real message is something like Call to undefined method Proxy?1::doesNotExist() from scope net.xp_framework.unittest.remote.IntegrationTest, but the class name is generated, and the scope may change when the class is moved, so we only want to check on parts of it. This new feature makes this possible.
|
Subscribe
You can subscribe to the XP framework's news by using RSS syndication.
CategoriesNews General PHP5 Announcements RFCs Further reading Examples Editorial EASC Experiments Unittests Databases 5.8-SERIES Unicode Language 5.9-SERIES
RelatedFind related articles by a search for «Matching».
|