2010-05-08 20:26:21 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This class helps in testing the life-cycle of fixtures inside a CakeTestCase
|
|
|
|
*
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Test.Fixture
|
2010-05-08 20:26:21 +00:00
|
|
|
*/
|
2010-06-24 15:22:43 +00:00
|
|
|
class FixturizedTestCase extends CakeTestCase {
|
2010-05-08 20:44:22 +00:00
|
|
|
|
2010-05-08 21:06:11 +00:00
|
|
|
/**
|
|
|
|
* Fixtures to use in this thes
|
2011-10-28 05:01:17 +00:00
|
|
|
* @var array
|
2010-05-08 21:06:11 +00:00
|
|
|
*/
|
2010-05-08 20:26:21 +00:00
|
|
|
public $fixtures = array('core.category');
|
|
|
|
|
2010-05-08 21:06:11 +00:00
|
|
|
/**
|
|
|
|
* test that the shared fixture is correctly set
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-05-08 20:26:21 +00:00
|
|
|
public function testFixturePresent() {
|
2010-12-24 17:54:04 +00:00
|
|
|
$this->assertInstanceOf('CakeFixtureManager', $this->fixtureManager);
|
2010-05-08 20:26:21 +00:00
|
|
|
}
|
2010-05-08 20:44:22 +00:00
|
|
|
|
2010-05-08 21:06:11 +00:00
|
|
|
/**
|
|
|
|
* test that it is possible to load fixtures on demand
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-05-08 20:44:22 +00:00
|
|
|
public function testFixtureLoadOnDemand() {
|
|
|
|
$this->loadFixtures('Category');
|
|
|
|
}
|
2010-05-08 21:06:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* test that a test is marked as skipped using skipIf and its first parameter evaluates to true
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testSkipIfTrue() {
|
|
|
|
$this->skipIf(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* test that a test is not marked as skipped using skipIf and its first parameter evaluates to false
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testSkipIfFalse() {
|
|
|
|
$this->skipIf(false);
|
|
|
|
}
|
2010-06-01 03:37:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* test that a fixtures are unoaded even if the test throws exceptions
|
|
|
|
*
|
|
|
|
* @return void
|
2012-03-18 03:31:17 +00:00
|
|
|
* @throws Exception
|
2010-06-01 03:37:21 +00:00
|
|
|
*/
|
|
|
|
public function testThrowException() {
|
|
|
|
throw new Exception();
|
|
|
|
}
|
2011-11-03 03:25:09 +00:00
|
|
|
}
|