Bug Report #4707
strange behavior around @expectedException
| Status: | New | Start date: | 02/25/2013 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | Spent time: | - | |
| Target version: | - | |||
| Resolution: | Points: | 1 |
Description
when trying to use the @expectedException PHPUnit comment (incorrectly)
Kohana_Unittest_TestCase breaks strangely.
this code is technically incorrect
/**
* Testing kohana phpunit behavior
*
* @expectedException Exception
*/
public function testExceptionErrors()
{
throw new Exception('foo');
}
and under phpunit will normally generate this error/hint
- InvalidArgumentException: You must not expect the generic exception class.*
but instead i get this from Kohana's PHPUnit module
-----------------------------------------------------------------------------------------
ErrorException [ Fatal Error ]: Call to a member function restore_environment() on a non-object MODPATH/unittest/classes/Kohana/Unittest/TestCase.php [ 65 ]
-----------------------------------------------------------------------------------------
60 * Extending classes that have their own tearDown()
61 * should call parent::tearDown()
62 /
63 public function tearDown()
64 {
65 $this->_helpers->restore_environment();
66 }
67
68 /*
69 * Removes all kohana related cache files in the cache directory
70 */
its not a major bug, but it was confusing