2010-05-08 20:26:21 +00:00
|
|
|
<?php
|
2010-05-08 21:06:11 +00:00
|
|
|
|
2010-09-28 03:07:23 +00:00
|
|
|
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
2010-05-08 21:06:11 +00:00
|
|
|
|
2010-05-08 20:26:21 +00:00
|
|
|
/**
|
|
|
|
* This class helps in testing the life-cycle of fixtures inside a CakeTestCase
|
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.tests.fixtures
|
|
|
|
*/
|
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
|
|
|
|
* @var array
|
|
|
|
*/
|
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() {
|
|
|
|
$this->assertType('CakeFixtureManager', $this->sharedFixture);
|
|
|
|
}
|
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
|
|
|
|
*/
|
|
|
|
public function testThrowException() {
|
|
|
|
throw new Exception();
|
|
|
|
}
|
2010-05-08 20:26:21 +00:00
|
|
|
}
|