2008-09-01 14:21:57 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* CakeTestFixture file
|
2008-09-01 14:21:57 +00:00
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2010-05-19 01:15:13 +00:00
|
|
|
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-09-01 14:21:57 +00:00
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-05-19 01:15:13 +00:00
|
|
|
* @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.tests.libs
|
|
|
|
* @since CakePHP(tm) v 1.2.0.4667
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-09-01 14:21:57 +00:00
|
|
|
*/
|
2009-07-26 01:27:02 +00:00
|
|
|
App::import('Datasource', 'DboSource', false);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* CakeTestFixtureTestFixture class
|
2008-09-01 14:21:57 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.tests.cases.libs
|
2008-09-01 14:21:57 +00:00
|
|
|
*/
|
|
|
|
class CakeTestFixtureTestFixture extends CakeTestFixture {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* name Property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $name = 'FixtureTest';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* table property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $table = 'fixture_tests';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Fields array
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
var $fields = array(
|
|
|
|
'id' => array('type' => 'integer', 'key' => 'primary'),
|
2009-04-28 22:20:04 +00:00
|
|
|
'name' => array('type' => 'string', 'length' => '255'),
|
|
|
|
'created' => array('type' => 'datetime')
|
2008-09-01 14:21:57 +00:00
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Records property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
var $records = array(
|
2009-08-02 06:47:28 +00:00
|
|
|
array('name' => 'Gandalf', 'created' => '2009-04-28 19:20:00'),
|
|
|
|
array('name' => 'Captain Picard', 'created' => '2009-04-28 19:20:00'),
|
|
|
|
array('name' => 'Chewbacca', 'created' => '2009-04-28 19:20:00')
|
2008-09-01 14:21:57 +00:00
|
|
|
);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* CakeTestFixtureImportFixture class
|
2008-09-01 14:21:57 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.tests.cases.libs
|
2008-09-01 14:21:57 +00:00
|
|
|
*/
|
|
|
|
class CakeTestFixtureImportFixture extends CakeTestFixture {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Name property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $name = 'ImportFixture';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Import property
|
|
|
|
*
|
2008-11-12 17:00:00 +00:00
|
|
|
* @var mixed
|
2008-11-08 02:58:37 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
var $import = array('table' => 'fixture_tests', 'connection' => 'test_suite');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-12 17:00:00 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* CakeTestFixtureDefaultImportFixture class
|
2008-11-12 17:00:00 +00:00
|
|
|
*
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.tests.cases.libs
|
|
|
|
*/
|
|
|
|
class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-11-12 17:00:00 +00:00
|
|
|
/**
|
|
|
|
* Name property
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $name = 'ImportFixture';
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* FixtureImportTestModel class
|
2008-09-01 14:21:57 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package default
|
|
|
|
* @subpackage cake.cake.tests.cases.libs.
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
class FixtureImportTestModel extends Model {
|
|
|
|
var $name = 'FixtureImport';
|
|
|
|
var $useTable = 'fixture_tests';
|
|
|
|
var $useDbConfig = 'test_suite';
|
|
|
|
}
|
2010-06-09 03:30:57 +00:00
|
|
|
|
|
|
|
class FixturePrefixTest extends Model {
|
|
|
|
var $name = 'FixturePrefix';
|
|
|
|
var $useTable = '_tests';
|
|
|
|
var $tablePrefix = 'fixture';
|
|
|
|
var $useDbConfig = 'test_suite';
|
|
|
|
}
|
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
Mock::generate('DboSource', 'FixtureMockDboSource');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Test case for CakeTestFixture
|
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.tests.cases.libs
|
2008-09-01 14:21:57 +00:00
|
|
|
*/
|
|
|
|
class CakeTestFixtureTest extends CakeTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-03-18 17:55:58 +00:00
|
|
|
/**
|
|
|
|
* setUp method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
function setUp() {
|
|
|
|
$this->criticDb =& new FixtureMockDboSource();
|
|
|
|
$this->criticDb->fullDebug = true;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-03-18 17:55:58 +00:00
|
|
|
/**
|
|
|
|
* tearDown
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function tearDown() {
|
|
|
|
unset($this->criticDb);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* testInit
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testInit() {
|
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
unset($Fixture->table);
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual($Fixture->table, 'fixture_tests');
|
|
|
|
$this->assertEqual($Fixture->primaryKey, 'id');
|
2008-09-04 01:49:29 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
$Fixture->primaryKey = 'my_random_key';
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual($Fixture->primaryKey, 'my_random_key');
|
2010-06-09 03:30:57 +00:00
|
|
|
}
|
2008-09-04 01:49:29 +00:00
|
|
|
|
2010-06-09 03:30:57 +00:00
|
|
|
/**
|
|
|
|
* test that init() correctly sets the fixture table when the connection or model have prefixes defined.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testInitDbPrefix() {
|
2008-09-01 14:21:57 +00:00
|
|
|
$this->_initDb();
|
|
|
|
$Source =& new CakeTestFixtureTestFixture();
|
|
|
|
$Source->create($this->db);
|
|
|
|
$Source->insert($this->db);
|
2008-09-04 01:49:29 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$Fixture =& new CakeTestFixtureImportFixture();
|
|
|
|
$expected = array('id', 'name', 'created');
|
|
|
|
$this->assertEqual(array_keys($Fixture->fields), $expected);
|
2008-09-04 01:49:29 +00:00
|
|
|
|
|
|
|
$db =& ConnectionManager::getDataSource('test_suite');
|
|
|
|
$config = $db->config;
|
|
|
|
$config['prefix'] = 'fixture_test_suite_';
|
|
|
|
ConnectionManager::create('fixture_test_suite', $config);
|
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$Fixture->fields = $Fixture->records = null;
|
|
|
|
$Fixture->import = array('table' => 'fixture_tests', 'connection' => 'test_suite', 'records' => true);
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual(count($Fixture->records), count($Source->records));
|
2008-09-04 01:49:29 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$Fixture =& new CakeTestFixtureImportFixture();
|
2010-07-30 02:01:12 +00:00
|
|
|
$Fixture->fields = $Fixture->records = $Fixture->table = null;
|
2008-10-07 03:58:04 +00:00
|
|
|
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test_suite');
|
2008-09-01 14:21:57 +00:00
|
|
|
$Fixture->init();
|
2008-09-01 23:04:59 +00:00
|
|
|
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
2010-07-30 02:01:12 +00:00
|
|
|
$this->assertEqual($Fixture->table, 'fixture_tests');
|
|
|
|
|
2008-09-04 01:49:29 +00:00
|
|
|
$keys = array_flip(ClassRegistry::keys());
|
|
|
|
$this->assertFalse(array_key_exists('fixtureimporttestmodel', $keys));
|
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$Source->drop($this->db);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-07-30 02:01:12 +00:00
|
|
|
/**
|
|
|
|
* test that fixtures don't duplicate the test db prefix.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testInitDbPrefixDuplication() {
|
|
|
|
$this->_initDb();
|
|
|
|
$backPrefix = $this->db->config['prefix'];
|
|
|
|
$this->db->config['prefix'] = 'cake_fixture_test_';
|
|
|
|
|
|
|
|
$Source =& new CakeTestFixtureTestFixture();
|
|
|
|
$Source->create($this->db);
|
|
|
|
$Source->insert($this->db);
|
|
|
|
|
|
|
|
$Fixture =& new CakeTestFixtureImportFixture();
|
|
|
|
$Fixture->fields = $Fixture->records = $Fixture->table = null;
|
|
|
|
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test_suite');
|
|
|
|
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
|
|
|
$this->assertEqual($Fixture->table, 'fixture_tests');
|
|
|
|
|
|
|
|
$Source->drop($this->db);
|
|
|
|
$this->db->config['prefix'] = $backPrefix;
|
|
|
|
}
|
|
|
|
|
2010-06-09 03:30:57 +00:00
|
|
|
/**
|
|
|
|
* test init with a model that has a tablePrefix declared.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testInitModelTablePrefix() {
|
|
|
|
$this->_initDb();
|
2010-07-30 02:01:12 +00:00
|
|
|
$hasPrefix = !empty($this->db->config['prefix']);
|
|
|
|
if ($this->skipIf($hasPrefix, 'Cannot run this test, you have a database connection prefix.')) {
|
|
|
|
return;
|
|
|
|
}
|
2010-06-09 03:30:57 +00:00
|
|
|
$Source =& new CakeTestFixtureTestFixture();
|
|
|
|
$Source->create($this->db);
|
|
|
|
$Source->insert($this->db);
|
|
|
|
|
|
|
|
$Fixture =& new CakeTestFixtureImportFixture();
|
|
|
|
unset($Fixture->table);
|
|
|
|
$Fixture->fields = $Fixture->records = null;
|
|
|
|
$Fixture->import = array('model' => 'FixturePrefixTest', 'connection' => 'test_suite', 'records' => false);
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual($Fixture->table, 'fixture_tests');
|
|
|
|
|
|
|
|
$keys = array_flip(ClassRegistry::keys());
|
|
|
|
$this->assertFalse(array_key_exists('fixtureimporttestmodel', $keys));
|
|
|
|
|
|
|
|
$Source->drop($this->db);
|
|
|
|
}
|
|
|
|
|
2008-11-12 17:00:00 +00:00
|
|
|
/**
|
|
|
|
* testImport
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testImport() {
|
|
|
|
$this->_initDb();
|
|
|
|
|
|
|
|
$defaultDb =& ConnectionManager::getDataSource('default');
|
|
|
|
$testSuiteDb =& ConnectionManager::getDataSource('test_suite');
|
|
|
|
$defaultConfig = $defaultDb->config;
|
|
|
|
$testSuiteConfig = $testSuiteDb->config;
|
|
|
|
ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
|
|
|
$newTestSuiteDb =& ConnectionManager::getDataSource('new_test_suite');
|
|
|
|
|
|
|
|
$Source =& new CakeTestFixtureTestFixture();
|
|
|
|
$Source->create($newTestSuiteDb);
|
|
|
|
$Source->insert($newTestSuiteDb);
|
|
|
|
|
|
|
|
$defaultDb->config = $newTestSuiteDb->config;
|
|
|
|
|
|
|
|
$Fixture =& new CakeTestFixtureDefaultImportFixture();
|
|
|
|
$Fixture->fields = $Fixture->records = null;
|
2008-12-11 19:16:02 +00:00
|
|
|
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite');
|
2008-11-12 17:00:00 +00:00
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
|
|
|
|
|
|
|
$defaultDb->config = $defaultConfig;
|
|
|
|
|
|
|
|
$keys = array_flip(ClassRegistry::keys());
|
|
|
|
$this->assertFalse(array_key_exists('fixtureimporttestmodel', $keys));
|
|
|
|
|
|
|
|
$Source->drop($newTestSuiteDb);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-03-23 03:28:58 +00:00
|
|
|
/**
|
|
|
|
* test that importing with records works. Make sure to try with postgres as its
|
|
|
|
* handling of aliases is a workaround at best.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testImportWithRecords() {
|
|
|
|
$this->_initDb();
|
|
|
|
|
|
|
|
$defaultDb =& ConnectionManager::getDataSource('default');
|
|
|
|
$testSuiteDb =& ConnectionManager::getDataSource('test_suite');
|
|
|
|
$defaultConfig = $defaultDb->config;
|
|
|
|
$testSuiteConfig = $testSuiteDb->config;
|
|
|
|
ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
|
|
|
|
$newTestSuiteDb =& ConnectionManager::getDataSource('new_test_suite');
|
|
|
|
|
|
|
|
$Source =& new CakeTestFixtureTestFixture();
|
|
|
|
$Source->create($newTestSuiteDb);
|
|
|
|
$Source->insert($newTestSuiteDb);
|
|
|
|
|
|
|
|
$defaultDb->config = $newTestSuiteDb->config;
|
|
|
|
|
|
|
|
$Fixture =& new CakeTestFixtureDefaultImportFixture();
|
|
|
|
$Fixture->fields = $Fixture->records = null;
|
|
|
|
$Fixture->import = array(
|
|
|
|
'model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite', 'records' => true
|
|
|
|
);
|
|
|
|
$Fixture->init();
|
|
|
|
$this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created'));
|
|
|
|
$this->assertFalse(empty($Fixture->records[0]), 'No records loaded on importing fixture.');
|
|
|
|
$this->assertTrue(isset($Fixture->records[0]['name']), 'No name loaded for first record');
|
|
|
|
|
|
|
|
$defaultDb->config = $defaultConfig;
|
|
|
|
|
|
|
|
$Source->drop($newTestSuiteDb);
|
|
|
|
}
|
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* test create method
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @access public
|
2008-09-01 14:21:57 +00:00
|
|
|
* @return void
|
2009-03-18 17:55:58 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
function testCreate() {
|
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
$this->criticDb->expectAtLeastOnce('execute');
|
|
|
|
$this->criticDb->expectAtLeastOnce('createSchema');
|
|
|
|
$return = $Fixture->create($this->criticDb);
|
|
|
|
$this->assertTrue($this->criticDb->fullDebug);
|
|
|
|
$this->assertTrue($return);
|
2008-11-08 02:58:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
unset($Fixture->fields);
|
|
|
|
$return = $Fixture->create($this->criticDb);
|
|
|
|
$this->assertFalse($return);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* test the insert method
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @access public
|
2008-09-01 14:21:57 +00:00
|
|
|
* @return void
|
2009-03-18 17:55:58 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
function testInsert() {
|
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
$this->criticDb->setReturnValue('insertMulti', true);
|
|
|
|
$this->criticDb->expectAtLeastOnce('insertMulti');
|
|
|
|
|
|
|
|
$return = $Fixture->insert($this->criticDb);
|
|
|
|
$this->assertTrue($this->criticDb->fullDebug);
|
|
|
|
$this->assertTrue($return);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Test the drop method
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @access public
|
2008-09-01 14:21:57 +00:00
|
|
|
* @return void
|
2009-03-18 17:55:58 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
function testDrop() {
|
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
$this->criticDb->setReturnValueAt(0, 'execute', true);
|
|
|
|
$this->criticDb->expectAtLeastOnce('execute');
|
|
|
|
$this->criticDb->expectAtLeastOnce('dropSchema');
|
2008-11-08 02:58:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$return = $Fixture->drop($this->criticDb);
|
|
|
|
$this->assertTrue($this->criticDb->fullDebug);
|
|
|
|
$this->assertTrue($return);
|
2008-11-08 02:58:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
$this->criticDb->setReturnValueAt(1, 'execute', false);
|
|
|
|
$return = $Fixture->drop($this->criticDb);
|
|
|
|
$this->assertFalse($return);
|
2011-02-09 02:53:12 +00:00
|
|
|
|
|
|
|
unset($Fixture->fields);
|
|
|
|
$return = $Fixture->drop($this->criticDb);
|
|
|
|
$this->assertFalse($return);
|
2008-09-01 14:21:57 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-09-01 14:21:57 +00:00
|
|
|
/**
|
|
|
|
* Test the truncate method.
|
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @access public
|
2008-09-01 14:21:57 +00:00
|
|
|
* @return void
|
2009-03-18 17:55:58 +00:00
|
|
|
*/
|
2008-09-01 14:21:57 +00:00
|
|
|
function testTruncate() {
|
|
|
|
$Fixture =& new CakeTestFixtureTestFixture();
|
|
|
|
$this->criticDb->expectAtLeastOnce('truncate');
|
|
|
|
$Fixture->truncate($this->criticDb);
|
|
|
|
$this->assertTrue($this->criticDb->fullDebug);
|
|
|
|
}
|
|
|
|
}
|