remove CAKE_TESTS constant

This commit is contained in:
AD7six 2011-04-17 13:14:34 +02:00
parent 0cb70ae3bb
commit 8f071e297c
4 changed files with 17 additions and 24 deletions

View file

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

View file

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

View file

@ -20,7 +20,7 @@ App::uses('AppModel', 'Model');
App::uses('CakeRequest', 'Network'); App::uses('CakeRequest', 'Network');
App::uses('CakeResponse', '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 * Test case for FormAuthentication

View file

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