Browse Source

remove CAKE_TESTS constant

AD7six 15 years ago
parent
commit
8f071e297c

+ 7 - 7
lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php

@@ -21,7 +21,7 @@ App::uses('CakeRequest', 'Network');
 App::uses('CakeResponse', 'Network');
 
 
-require_once  CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php';
+require_once  CAKE . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'models.php';
 
 /**
  * Test case for BasicAuthentication
@@ -100,7 +100,7 @@ class BasicAuthenticateTest extends CakeTestCase {
 	function testAuthenticateNoUsername() {
 		$request = new CakeRequest('posts/index', false);
 		$_SERVER['PHP_AUTH_PW'] = 'foobar';
-		
+
 		$this->response->expects($this->once())
 			->method('header')
 			->with('WWW-Authenticate: Basic realm="localhost"');
@@ -117,7 +117,7 @@ class BasicAuthenticateTest extends CakeTestCase {
 		$request = new CakeRequest('posts/index', false);
 		$_SERVER['PHP_AUTH_USER'] = 'mariano';
 		$_SERVER['PHP_AUTH_PW'] = null;
-		
+
 		$this->response->expects($this->once())
 			->method('header')
 			->with('WWW-Authenticate: Basic realm="localhost"');
@@ -152,10 +152,10 @@ class BasicAuthenticateTest extends CakeTestCase {
 		$this->response->expects($this->at(0))
 			->method('header')
 			->with('WWW-Authenticate: Basic realm="localhost"');
-		
+
 		$this->response->expects($this->at(1))
 			->method('send');
-		
+
 		$result = $this->auth->authenticate($request, $this->response);
 		$this->assertFalse($result);
 	}
@@ -201,11 +201,11 @@ class BasicAuthenticateTest extends CakeTestCase {
 		$this->response->expects($this->at(1))
 			->method('statusCode')
 			->with(401);
-		
+
 		$this->response->expects($this->at(2))
 			->method('send');
 
 		$this->assertFalse($this->auth->authenticate($request, $this->response));
 	}
 
-}
+}

+ 9 - 9
lib/Cake/Test/Case/Controller/Component/Auth/DigestAuthenticateTest.php

@@ -19,7 +19,7 @@ App::uses('AppModel', 'Model');
 App::uses('CakeRequest', 'Network');
 App::uses('CakeResponse', 'Network');
 
-require_once  CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php';
+require_once  CAKE . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'models.php';
 
 /**
  * Test case for DigestAuthentication
@@ -116,7 +116,7 @@ cnonce="0a4f113b",
 response="6629fae49393a05397450978507c4ef1",
 opaque="123abc"
 DIGEST;
-		
+
 		$this->response->expects($this->at(0))
 			->method('header')
 			->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
@@ -124,7 +124,7 @@ DIGEST;
 		$this->response->expects($this->at(1))
 			->method('statusCode')
 			->with(401);
-		
+
 		$this->response->expects($this->at(2))
 			->method('send');
 
@@ -143,14 +143,14 @@ DIGEST;
 		$this->response->expects($this->at(0))
 			->method('header')
 			->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
-		
+
 		$this->response->expects($this->at(1))
 			->method('statusCode')
 			->with(401);
-		
+
 		$this->response->expects($this->at(2))
 			->method('send');
-		
+
 		$result = $this->auth->authenticate($request, $this->response);
 		$this->assertFalse($result);
 	}
@@ -211,11 +211,11 @@ DIGEST;
 		$this->response->expects($this->at(0))
 			->method('header')
 			->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
-		
+
 		$this->response->expects($this->at(1))
 			->method('statusCode')
 			->with(401);
-		
+
 		$this->response->expects($this->at(2))
 			->method('send');
 
@@ -300,4 +300,4 @@ DIGEST;
 		$expected = md5('mark:localhost:password');
 		$this->assertEquals($expected, $result);
 	}
-}
+}

+ 1 - 1
lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticate.php

@@ -20,7 +20,7 @@ App::uses('AppModel', 'Model');
 App::uses('CakeRequest', 'Network');
 App::uses('CakeResponse', 'Network');
 
-require_once  CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php';
+require_once  CAKE . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'models.php';
 
 /**
  * Test case for FormAuthentication

+ 0 - 7
lib/Cake/bootstrap.php

@@ -76,13 +76,6 @@ if (!defined('TESTS')) {
 }
 
 /**
- * Path to the core tests directory.
- */
-if (!defined('CAKE_TESTS')) {
-	define('CAKE_TESTS', CAKE.'Test'.DS);
-}
-
-/**
  * Path to the temporary files directory.
  */
 if (!defined('TMP')) {