FixturizedTestCase.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Cake\Test\Fixture;
  3. use Cake\TestSuite\TestCase;
  4. /**
  5. * This class helps in testing the life-cycle of fixtures inside a CakeTestCase
  6. *
  7. */
  8. class FixturizedTestCase extends TestCase {
  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('Cake\TestSuite\Fixture\FixtureManager', $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. * @throws \Exception
  51. */
  52. public function testThrowException() {
  53. throw new \Exception();
  54. }
  55. }