2010-05-08 15:56:21 -04:30
|
|
|
<?php
|
2010-05-08 16:36:11 -04:30
|
|
|
|
2010-09-27 22:37:23 -04:30
|
|
|
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
2010-05-08 16:36:11 -04:30
|
|
|
|
2010-05-08 15:56:21 -04:30
|
|
|
/**
|
|
|
|
* This class helps in testing the life-cycle of fixtures inside a CakeTestCase
|
|
|
|
*
|
2010-12-24 13:57:20 -05:00
|
|
|
* @package cake.tests.fixtures
|
2010-05-08 15:56:21 -04:30
|
|
|
*/
|
2010-06-24 10:52:43 -04:30
|
|
|
class FixturizedTestCase extends CakeTestCase {
|
2010-05-08 16:14:22 -04:30
|
|
|
|
2010-05-08 16:36:11 -04:30
|
|
|
/**
|
|
|
|
* Fixtures to use in this thes
|
|
|
|
* @var array
|
|
|
|
*/
|
2010-05-08 15:56:21 -04:30
|
|
|
public $fixtures = array('core.category');
|
|
|
|
|
2010-05-08 16:36:11 -04:30
|
|
|
/**
|
|
|
|
* test that the shared fixture is correctly set
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-05-08 15:56:21 -04:30
|
|
|
public function testFixturePresent() {
|
2010-12-24 12:54:04 -05:00
|
|
|
$this->assertInstanceOf('CakeFixtureManager', $this->fixtureManager);
|
2010-05-08 15:56:21 -04:30
|
|
|
}
|
2010-05-08 16:14:22 -04:30
|
|
|
|
2010-05-08 16:36:11 -04:30
|
|
|
/**
|
|
|
|
* test that it is possible to load fixtures on demand
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-05-08 16:14:22 -04:30
|
|
|
public function testFixtureLoadOnDemand() {
|
|
|
|
$this->loadFixtures('Category');
|
|
|
|
}
|
2010-05-08 16:36:11 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-05-31 23:07:21 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* test that a fixtures are unoaded even if the test throws exceptions
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testThrowException() {
|
|
|
|
throw new Exception();
|
|
|
|
}
|
2010-05-08 15:56:21 -04:30
|
|
|
}
|