Skip to content

Commit

Permalink
remove CAKE_TESTS constant
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed May 15, 2011
1 parent 0cb70ae commit 8f071e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
Expand Up @@ -21,7 +21,7 @@
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
Expand Down Expand Up @@ -100,7 +100,7 @@ function testAuthenticateNoData() {
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"');
Expand All @@ -117,7 +117,7 @@ function testAuthenticateNoPassword() {
$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"');
Expand Down Expand Up @@ -152,10 +152,10 @@ function testAuthenticateChallenge() {
$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);
}
Expand Down Expand Up @@ -201,11 +201,11 @@ function testAuthenticateFailReChallenge() {
$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));
}

}
}
Expand Up @@ -19,7 +19,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 DigestAuthentication
Expand Down Expand Up @@ -116,15 +116,15 @@ function testAuthenticateWrongUsername() {
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"');

$this->response->expects($this->at(1))
->method('statusCode')
->with(401);

$this->response->expects($this->at(2))
->method('send');

Expand All @@ -143,14 +143,14 @@ function testAuthenticateChallenge() {
$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);
}
Expand Down Expand Up @@ -211,11 +211,11 @@ function testAuthenticateFailReChallenge() {
$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');

Expand Down Expand Up @@ -300,4 +300,4 @@ function testPassword() {
$expected = md5('mark:localhost:password');
$this->assertEquals($expected, $result);
}
}
}
Expand Up @@ -20,7 +20,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 FormAuthentication
Expand Down
7 changes: 0 additions & 7 deletions lib/Cake/bootstrap.php
Expand Up @@ -75,13 +75,6 @@
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.
*/
Expand Down

0 comments on commit 8f071e2

Please sign in to comment.