FixturizedTestCase.php 1.2 KB

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