Browse Source

Fix test cases.

ADmad 11 years ago
parent
commit
ff4f33b293

+ 5 - 5
tests/TestCase/Network/Email/EmailTest.php

@@ -728,16 +728,16 @@ class EmailTest extends TestCase {
 		$this->CakeEmail->attachments(array(
 			array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain')
 		));
-		$this->CakeEmail->addAttachments(CAKE . 'bootstrap.php');
-		$this->CakeEmail->addAttachments(array(CAKE . 'bootstrap.php'));
+		$this->CakeEmail->addAttachments(CORE_PATH . 'config' . DS . 'bootstrap.php');
+		$this->CakeEmail->addAttachments(array(CORE_PATH . 'config' . DS . 'bootstrap.php'));
 		$this->CakeEmail->addAttachments(array(
-			'other.txt' => CAKE . 'bootstrap.php',
+			'other.txt' => CORE_PATH . 'config' . DS . 'bootstrap.php',
 			'license' => CORE_PATH . 'LICENSE.txt'
 		));
 		$expected = array(
 			'basics.php' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain'),
-			'bootstrap.php' => array('file' => CAKE . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
-			'other.txt' => array('file' => CAKE . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
+			'bootstrap.php' => array('file' => CORE_PATH . 'config' . DS . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
+			'other.txt' => array('file' => CORE_PATH . 'config' . DS . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
 			'license' => array('file' => CORE_PATH . 'LICENSE.txt', 'mimetype' => 'application/octet-stream')
 		);
 		$this->assertSame($this->CakeEmail->attachments(), $expected);

+ 4 - 4
tests/TestCase/Network/ResponseTest.php

@@ -1326,7 +1326,7 @@ class ResponseTest extends TestCase {
 			->method('_isActive')
 			->will($this->returnValue(true));
 
-		$response->file(TEST_APP . 'TestApp/Config/no_section.ini');
+		$response->file(CONFIG . 'no_section.ini');
 
 		ob_start();
 		$result = $response->send();
@@ -1390,7 +1390,7 @@ class ResponseTest extends TestCase {
 			->method('_isActive')
 			->will($this->returnValue(true));
 
-		$response->file(TEST_APP . 'TestApp/Config/no_section.ini');
+		$response->file(CONFIG . 'no_section.ini');
 
 		ob_start();
 		$result = $response->send();
@@ -1454,7 +1454,7 @@ class ResponseTest extends TestCase {
 			->method('_isActive')
 			->will($this->returnValue(true));
 
-		$response->file(TEST_APP . 'TestApp/Config/no_section.ini', array(
+		$response->file(CONFIG . 'no_section.ini', array(
 			'name' => 'config.ini'
 		));
 
@@ -1495,7 +1495,7 @@ class ResponseTest extends TestCase {
 		$response->expects($this->never())
 			->method('download');
 
-		$response->file(TEST_APP . 'TestApp/Config/no_section.ini', array(
+		$response->file(CONFIG . 'no_section.ini', array(
 			'download' => false
 		));
 

+ 15 - 15
tests/TestCase/Utility/FolderTest.php

@@ -222,7 +222,7 @@ class FolderTest extends TestCase {
 		$result = $Folder->delete($mv);
 		$this->assertTrue($result);
 
-		$new = APP . 'Config/acl.ini';
+		$new = CONFIG . 'acl.ini';
 		$result = $Folder->create($new);
 		$this->assertFalse($result);
 
@@ -404,22 +404,22 @@ class FolderTest extends TestCase {
 		$Folder = new Folder();
 		$expected = array(
 			array(
-				CAKE . 'Config',
+				CORE_PATH . 'config',
 			),
 			array(
-				CAKE . 'Config' . DS . 'config.php',
+				CORE_PATH . 'config' . DS . 'config.php',
 			)
 		);
 
-		$result = $Folder->tree(CAKE . 'Config', false);
+		$result = $Folder->tree(CORE_PATH . 'config', false);
 		$this->assertSame(array(), array_diff($expected[0], $result[0]));
 		$this->assertSame(array(), array_diff($result[0], $expected[0]));
 
-		$result = $Folder->tree(CAKE . 'Config', false, 'dir');
+		$result = $Folder->tree(CORE_PATH . 'config', false, 'dir');
 		$this->assertSame(array(), array_diff($expected[0], $result));
 		$this->assertSame(array(), array_diff($expected[0], $result));
 
-		$result = $Folder->tree(CAKE . 'Config', false, 'files');
+		$result = $Folder->tree(CORE_PATH . 'config', false, 'files');
 		$this->assertSame(array(), array_diff($expected[1], $result));
 		$this->assertSame(array(), array_diff($expected[1], $result));
 	}
@@ -597,8 +597,8 @@ class FolderTest extends TestCase {
 		$result = $Folder->inCakePath($path);
 		$this->assertFalse($result);
 
-		$path = DS . 'src' . DS . 'Config';
-		$Folder->cd(ROOT . DS . 'src' . DS . 'Config');
+		$path = DS . 'config';
+		$Folder->cd(ROOT . DS . 'config');
 		$result = $Folder->inCakePath($path);
 		$this->assertTrue($result);
 	}
@@ -610,23 +610,23 @@ class FolderTest extends TestCase {
  */
 	public function testFind() {
 		$Folder = new Folder();
-		$Folder->cd(CAKE . 'Config');
+		$Folder->cd(CORE_PATH . 'config');
 		$result = $Folder->find();
 		$expected = array('config.php');
 		$this->assertSame(array_diff($expected, $result), array());
 		$this->assertSame(array_diff($expected, $result), array());
 
 		$result = $Folder->find('.*', true);
-		$expected = array('cacert.pem', 'config.php');
+		$expected = array('bootstrap.php', 'cacert.pem', 'config.php');
 		$this->assertSame($expected, $result);
 
 		$result = $Folder->find('.*\.php');
-		$expected = array('config.php');
+		$expected = array('bootstrap.php', 'config.php');
 		$this->assertSame(array_diff($expected, $result), array());
 		$this->assertSame(array_diff($expected, $result), array());
 
 		$result = $Folder->find('.*\.php', true);
-		$expected = array('config.php');
+		$expected = array('bootstrap.php', 'config.php');
 		$this->assertSame($expected, $result);
 
 		$result = $Folder->find('.*ig\.php');
@@ -657,17 +657,17 @@ class FolderTest extends TestCase {
  * @return void
  */
 	public function testFindRecursive() {
-		$Folder = new Folder(CAKE);
+		$Folder = new Folder(CORE_PATH);
 		$result = $Folder->findRecursive('(config|paths)\.php');
 		$expected = array(
-			CAKE . 'Config' . DS . 'config.php'
+			CORE_PATH . 'config' . DS . 'config.php'
 		);
 		$this->assertSame(array(), array_diff($expected, $result));
 		$this->assertSame(array(), array_diff($expected, $result));
 
 		$result = $Folder->findRecursive('(config|woot)\.php', true);
 		$expected = array(
-			CAKE . 'Config' . DS . 'config.php'
+			CORE_PATH . 'config' . DS . 'config.php'
 		);
 		$this->assertSame($expected, $result);