Skip to content

Commit

Permalink
test_suite suite now runs. Still has a few failing tests from the fix…
Browse files Browse the repository at this point in the history
…ture test case.
  • Loading branch information
markstory committed Sep 25, 2010
1 parent 32dc4aa commit 460a8bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions cake/tests/cases/libs/cake_test_case.test.php
Expand Up @@ -19,6 +19,7 @@
* @since CakePHP v 1.2.0.4487
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Controller', 'Controller', false);

if (!class_exists('AppController')) {
require_once LIBS . 'controller' . DS . 'app_controller.php';
Expand Down
22 changes: 11 additions & 11 deletions cake/tests/cases/libs/cake_test_fixture.test.php
Expand Up @@ -223,13 +223,13 @@ function testInitDbPrefix() {
* @return void
*/
function testInitDbPrefixDuplication() {
$this->_initDb();
$backPrefix = $this->db->config['prefix'];
$this->db->config['prefix'] = 'cake_fixture_test_';
$db = ConnectionManager::getDataSource('test');
$backPrefix = $db->config['prefix'];
$db->config['prefix'] = 'cake_fixture_test_';

$Source =& new CakeTestFixtureTestFixture();
$Source->create($this->db);
$Source->insert($this->db);
$Source->create($db);
$Source->insert($db);

$Fixture =& new CakeTestFixtureImportFixture();
$Fixture->fields = $Fixture->records = $Fixture->table = null;
Expand All @@ -239,8 +239,8 @@ function testInitDbPrefixDuplication() {
$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;
$Source->drop($db);
$db->config['prefix'] = $backPrefix;
}

/**
Expand All @@ -249,10 +249,10 @@ function testInitDbPrefixDuplication() {
* @return void
*/
function testInitModelTablePrefix() {
$this->_initDb();
$hasPrefix = !empty($this->db->config['prefix']);
if ($this->skipIf($hasPrefix, 'Cannot run this test, you have a database connection prefix.')) {
return;
$db = ConnectionManager::getDataSource('test');
$hasPrefix = !empty($db->config['prefix']);
if ($hasPrefix) {
$this->markTestSkipped('Cannot run this test, you have a database connection prefix.');
}
$Source =& new CakeTestFixtureTestFixture();
$Source->create($db);
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/test_manager.test.php
Expand Up @@ -116,7 +116,7 @@ public function testRunUnexistentCase() {
* @return void
*/
public function testRunTestCase() {
$file = __FILE__;
$file = 'libs/test_manager.test.php';
$result = $this->TestManager->runTestCase($file, $this->Reporter, true);
$this->assertEquals(1, $this->_countFiles);
$this->assertType('PHPUnit_Framework_TestResult', $result);
Expand Down
2 changes: 0 additions & 2 deletions cake/tests/lib/test_manager.php
Expand Up @@ -214,8 +214,6 @@ public static function addTestCasesFromDirectory(&$groupTest, $directory = '.')
public static function addTestFile(&$groupTest, $file) {
if (file_exists($file . self::$_testExtension)) {
$file .= self::$_testExtension;
} elseif (file_exists($file . self::$_groupExtension)) {
$file .= self::$_groupExtension;
}
$groupTest->addTestFile($file);
}
Expand Down

0 comments on commit 460a8bc

Please sign in to comment.