From 90299c0d0e86a0c01310bd75b37b439eb53bc2b8 Mon Sep 17 00:00:00 2001 From: phpnut Date: Sat, 23 Jun 2007 05:56:36 +0000 Subject: [PATCH] Removed extra slash in test paths. Removed extra lines in files. Corrected header in file git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5340 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../model/datasources/dbo_source.test.php | 49 +++++++++---------- cake/tests/fixtures/number_tree_fixture.php | 21 ++++---- cake/tests/fixtures/post_fixture.php | 1 - cake/tests/lib/test_manager.php | 4 +- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index e8ab83eda..25702cc94 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -983,14 +983,14 @@ class DboSourceTest extends UnitTestCase { $this->assertPattern('/\s+FROM\s+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); $this->assertPattern('/\s+WHERE\s+(?:\()?`TestModel5`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); } - + function testGenerateAssociationQueryHasManyWithOffsetAndLimit() { $this->model = new TestModel5(); $this->model->loadInfo(); $this->_buildRelatedModels($this->model); - + $__backup = $this->model->hasMany['TestModel6']; - + $this->model->hasMany['TestModel6']['offset'] = 2; $this->model->hasMany['TestModel6']['limit'] = 5; @@ -1006,22 +1006,22 @@ class DboSourceTest extends UnitTestCase { $this->assertPattern('/\s+FROM\s+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); $this->assertPattern('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+IN\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $this->assertPattern('/\s+LIMIT 2,\s*5\s*$/', $result); - + $result = $this->db->generateAssociationQuery($this->model, $null, null, null, null, $queryData, false, $null); $this->assertPattern('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); $this->assertPattern('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); - + $this->model->hasMany['TestModel6'] = $__backup; } - + function testGenerateAssociationQueryHasManyWithPageAndLimit() { $this->model = new TestModel5(); $this->model->loadInfo(); $this->_buildRelatedModels($this->model); - + $__backup = $this->model->hasMany['TestModel6']; - + $this->model->hasMany['TestModel6']['page'] = 2; $this->model->hasMany['TestModel6']['limit'] = 5; @@ -1037,12 +1037,12 @@ class DboSourceTest extends UnitTestCase { $this->assertPattern('/\s+FROM\s+`test_model6` AS `TestModel6`\s+WHERE\s+/', $result); $this->assertPattern('/WHERE\s+(?:\()?`TestModel6`\.`test_model5_id`\s+IN\s+\({\$__cakeID__\$}\)(?:\))?/', $result); $this->assertPattern('/\s+LIMIT 5,\s*5\s*$/', $result); - + $result = $this->db->generateAssociationQuery($this->model, $null, null, null, null, $queryData, false, $null); $this->assertPattern('/^SELECT\s+`TestModel5`\.`id`, `TestModel5`\.`test_model4_id`, `TestModel5`\.`name`, `TestModel5`\.`created`, `TestModel5`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result); $this->assertPattern('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); - + $this->model->hasMany['TestModel6'] = $__backup; } @@ -1213,17 +1213,17 @@ class DboSourceTest extends UnitTestCase { $this->assertPattern('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?`TestModel4`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result); } - + function testGenerateAssociationQueryHasAndBelongsToManyWithOffsetAndLimit() { $this->model = new TestModel4(); $this->model->loadInfo(); $this->_buildRelatedModels($this->model); - + $__backup = $this->model->hasAndBelongsToMany['TestModel7']; - + $this->model->hasAndBelongsToMany['TestModel7']['offset'] = 2; $this->model->hasAndBelongsToMany['TestModel7']['limit'] = 5; - + $binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7'); $queryData = array(); $resultSet = null; @@ -1232,30 +1232,30 @@ class DboSourceTest extends UnitTestCase { $params = &$this->_prepareAssociationQuery($this->model, $queryData, $binding); $result = $this->db->generateAssociationQuery($this->model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external'], $resultSet); - + $this->assertPattern('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model7` AS `TestModel7`\s+JOIN\s+`test_model4_test_model7`+/', $result); $this->assertPattern('/\s+ON\s+(?:\()?`test_model4_test_model7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}(?:\))?/', $result); $this->assertPattern('/\s+AND\s+(?:\()?`test_model4_test_model7`\.`test_model7_id`\s+=\s+`TestModel7`.`id`(?:\))?\s+WHERE\s+/', $result); $this->assertPattern('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 2,\s*5\s*$/', $result); - + $result = $this->db->generateAssociationQuery($this->model, $null, null, null, null, $queryData, false, $null); $this->assertPattern('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); - + $this->model->hasAndBelongsToMany['TestModel7'] = $__backup; } - + function testGenerateAssociationQueryHasAndBelongsToManyWithPageAndLimit() { $this->model = new TestModel4(); $this->model->loadInfo(); $this->_buildRelatedModels($this->model); - + $__backup = $this->model->hasAndBelongsToMany['TestModel7']; - + $this->model->hasAndBelongsToMany['TestModel7']['page'] = 2; $this->model->hasAndBelongsToMany['TestModel7']['limit'] = 5; - + $binding = array('type'=>'hasAndBelongsToMany', 'model'=>'TestModel7'); $queryData = array(); $resultSet = null; @@ -1264,17 +1264,17 @@ class DboSourceTest extends UnitTestCase { $params = &$this->_prepareAssociationQuery($this->model, $queryData, $binding); $result = $this->db->generateAssociationQuery($this->model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external'], $resultSet); - + $this->assertPattern('/^SELECT\s+`TestModel7`\.`id`, `TestModel7`\.`name`, `TestModel7`\.`created`, `TestModel7`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model7` AS `TestModel7`\s+JOIN\s+`test_model4_test_model7`+/', $result); $this->assertPattern('/\s+ON\s+(?:\()?`test_model4_test_model7`\.`test_model4_id`\s+=\s+{\$__cakeID__\$}(?:\))?/', $result); $this->assertPattern('/\s+AND\s+(?:\()?`test_model4_test_model7`\.`test_model7_id`\s+=\s+`TestModel7`.`id`(?:\))?\s+WHERE\s+/', $result); $this->assertPattern('/\s+(?:\()?1\s+=\s+1(?:\))?\s*\s+LIMIT 5,\s*5\s*$/', $result); - + $result = $this->db->generateAssociationQuery($this->model, $null, null, null, null, $queryData, false, $null); $this->assertPattern('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result); $this->assertPattern('/\s+FROM\s+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result); - + $this->model->hasAndBelongsToMany['TestModel7'] = $__backup; } @@ -1603,7 +1603,6 @@ class DboSourceTest extends UnitTestCase { $expected = " WHERE `TestModel`.`field` = 'gribe$@()lu'"; $this->assertEqual($result, $expected); - $conditions['NOT'] = array('Listing.expiration' => "BETWEEN 1 AND 100"); $conditions[0]['OR'] = array( "Listing.title" => "LIKE %term%", diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index 943b28de0..b4b6e21df 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -1,6 +1,5 @@ - * Copyright (c) 2006, Cake Software Foundation, Inc. + * CakePHP(tm) Tests + * Copyright 2005-2007, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright (c) 2006, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project - * @package cake + * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake.tests * @subpackage cake.tests.fixtures - * @since CakePHP v 1.2.0.4487 + * @since CakePHP(tm) v 1.2.0.5331 * @version $Revision$ * @modifiedby $LastChangedBy$ * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ /** * Number Tree Test Fixture @@ -44,4 +43,4 @@ class NumberTreeFixture extends CakeTestFixture { 'lft' => array ('type' => 'integer','null' => false), 'rght' => array ('type' => 'integer','null' => false)); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index 5ce0ffe66..2111c214c 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -49,5 +49,4 @@ class PostFixture extends CakeTestFixture { array ('id' => 3, 'author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') ); } - ?> \ No newline at end of file diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 99d1064f6..1622217bc 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -58,9 +58,9 @@ class TestManager { $manager =& new TestManager(); if (!empty($manager->usersAppTest)) { - $testCasePath = APP_TEST_CASES . DIRECTORY_SEPARATOR; + $testCasePath = APP_TEST_CASES; } else { - $testCasePath = CORE_TEST_CASES . DIRECTORY_SEPARATOR; + $testCasePath = CORE_TEST_CASES; } $testCases =& $manager->_getTestFileList($testCasePath); $test =& new GroupTest('All Core Tests');