FixturizedTestCase.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
  3. /**
  4. * This class helps in testing the life-cycle of fixtures inside a CakeTestCase
  5. *
  6. * @package Cake.Test.Fixture
  7. */
  8. class FixturizedTestCase extends CakeTestCase {
  9. /**
  10. * Fixtures to use in this thes
  11. * @var array
  12. */
  13. public $fixtures = array('core.category');
  14. /**
  15. * test that the shared fixture is correctly set
  16. *
  17. * @return void
  18. */
  19. public function testFixturePresent() {
  20. $this->assertInstanceOf('CakeFixtureManager', $this->fixtureManager);
  21. }
  22. /**
  23. * test that it is possible to load fixtures on demand
  24. *
  25. * @return void
  26. */
  27. public function testFixtureLoadOnDemand() {
  28. $this->loadFixtures('Category');
  29. }
  30. /**
  31. * test that a test is marked as skipped using skipIf and its first parameter evaluates to true
  32. *
  33. * @return void
  34. */
  35. public function testSkipIfTrue() {
  36. $this->skipIf(true);
  37. }
  38. /**
  39. * test that a test is not marked as skipped using skipIf and its first parameter evaluates to false
  40. *
  41. * @return void
  42. */
  43. public function testSkipIfFalse() {
  44. $this->skipIf(false);
  45. }
  46. /**
  47. * test that a fixtures are unoaded even if the test throws exceptions
  48. *
  49. * @return void
  50. */
  51. public function testThrowException() {
  52. throw new Exception();
  53. }
  54. }