ExceptionInAssertPostConditionsTest.php 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class ExceptionInAssertPostConditionsTest extends PHPUnit_Framework_TestCase
  3. {
  4. public $setUp = false;
  5. public $assertPreConditions = false;
  6. public $assertPostConditions = false;
  7. public $tearDown = false;
  8. public $testSomething = false;
  9. protected function setUp()
  10. {
  11. $this->setUp = true;
  12. }
  13. protected function assertPreConditions()
  14. {
  15. $this->assertPreConditions = true;
  16. }
  17. public function testSomething()
  18. {
  19. $this->testSomething = true;
  20. }
  21. protected function assertPostConditions()
  22. {
  23. $this->assertPostConditions = true;
  24. throw new Exception;
  25. }
  26. protected function tearDown()
  27. {
  28. $this->tearDown = true;
  29. }
  30. }