Skip to content
Permalink
Browse files

Fixing some failing unit tests

  • Loading branch information...
lorenzo committed Aug 30, 2014
1 parent 18ed6de commit 512d385b4e589e9e10b1c9ff2c64059cfe518f6b
@@ -15,7 +15,7 @@
namespace Cake\Test\TestCase\Auth;
use Cake\Auth\BasicAuthenticate;
use Cake\Error;
use Cake\Network\Exception\UnauthorizedException;
use Cake\Network\Request;
use Cake\ORM\Entity;
use Cake\ORM\TableRegistry;
@@ -168,7 +168,7 @@ public function testAuthenticateChallenge() {
try {
$this->auth->unauthenticated($request, $this->response);
} catch (Error\UnauthorizedException $e) {
} catch (UnauthorizedException $e) {
}
$this->assertNotEmpty($e);
@@ -205,7 +205,7 @@ public function testAuthenticateSuccess() {
/**
* test scope failure.
*
* @expectedException \Cake\Error\UnauthorizedException
* @expectedException \Cake\Network\Exception\UnauthorizedException
* @expectedExceptionCode 401
* @return void
*/
@@ -17,7 +17,7 @@
namespace Cake\Test\TestCase\Auth;
use Cake\Auth\DigestAuthenticate;
use Cake\Error;
use Cake\Network\Exception\UnauthorizedException;
use Cake\Network\Request;
use Cake\ORM\Entity;
use Cake\ORM\TableRegistry;
@@ -93,7 +93,7 @@ public function testAuthenticateNoData() {
/**
* test the authenticate method
*
* @expectedException \Cake\Error\UnauthorizedException
* @expectedException \Cake\Network\Exception\UnauthorizedException
* @expectedExceptionCode 401
* @return void
*/
@@ -131,7 +131,7 @@ public function testAuthenticateChallenge() {
try {
$this->auth->unauthenticated($request, $this->response);
} catch (Error\UnauthorizedException $e) {
} catch (UnauthorizedException $e) {
}
$this->assertNotEmpty($e);
@@ -178,7 +178,7 @@ public function testAuthenticateSuccess() {
/**
* test scope failure.
*
* @expectedException \Cake\Error\UnauthorizedException
* @expectedException \Cake\Network\Exception\UnauthorizedException
* @expectedExceptionCode 401
* @return void
*/
@@ -87,6 +87,7 @@ public function testConfig() {
'persistent' => true,
'password' => false,
'database' => 0,
'unix_socket' => false
);
$this->assertEquals($expecting, $config);
}
@@ -19,8 +19,9 @@
use Cake\Controller\Controller;
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Error;
use Cake\Event\Event;
use Cake\Network\Exception\ForbiddenException;
use Cake\Network\Exception\UnauthorizedException;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Network\Session;
@@ -789,7 +790,7 @@ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() {
/**
* Throw ForbiddenException if config `unauthorizedRedirect` is set to false
*
* @expectedException \Cake\Error\ForbiddenException
* @expectedException \Cake\Network\Exception\ForbiddenException
* @return void
*/
public function testForbiddenException() {
@@ -1261,7 +1262,7 @@ public function testUser() {
/**
* testStatelessAuthNoRedirect method
*
* @expectedException \Cake\Error\UnauthorizedException
* @expectedException \Cake\Network\Exception\UnauthorizedException
* @expectedExceptionCode 401
* @return void
*/
@@ -107,7 +107,7 @@ public function testValidTokenInHeader($method) {
* Test that the X-CSRF-Token works with the various http methods.
*
* @dataProvider httpMethodProvider
* @expectedException \Cake\Error\ForbiddenException
* @expectedException \Cake\Network\Exception\ForbiddenException
* @return void
*/
public function testInvalidTokenInHeader($method) {
@@ -149,7 +149,7 @@ public function testValidTokenRequestData($method) {
* Test that request data works with the various http methods.
*
* @dataProvider httpMethodProvider
* @expectedException \Cake\Error\ForbiddenException
* @expectedException \Cake\Network\Exception\ForbiddenException
* @return void
*/
public function testInvalidTokenRequestData($method) {
@@ -19,7 +19,7 @@
use Cake\Controller\Controller;
use Cake\Core\Configure;
use Cake\Datasource\ConnectionManager;
use Cake\Error;
use Cake\Network\Exception\NotFoundException;
use Cake\Network\Request;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
@@ -472,7 +472,7 @@ public function testOutOfRangePageNumberGetsClamped() {
try {
$this->Paginator->paginate($table);
$this->fail('No exception raised');
} catch (\Cake\Error\NotFoundException $e) {
} catch (NotFoundException $e) {
$this->assertEquals(
1,
$this->request->params['paging']['PaginatorPosts']['page'],
@@ -484,7 +484,7 @@ public function testOutOfRangePageNumberGetsClamped() {
/**
* Test that a really REALLY large page number gets clamped to the max page size.
*
* @expectedException \Cake\Error\NotFoundException
* @expectedException \Cake\Network\Exception\NotFoundException
* @return void
*/
public function testOutOfVeryBigPageNumberGetsClamped() {
@@ -113,7 +113,7 @@ public function testCharset() {
/**
* Tests the statusCode method
*
* @expectedException \Cake\Core\Exception\Exception
* @expectedException InvalidArgumentException
* @return void
*/
public function testStatusCode() {
@@ -398,7 +398,7 @@ public function testCompress() {
/**
* Tests the httpCodes method
*
* @expectedException \Cake\Core\Exception\Exception
* @expectedException InvalidArgumentException
* @return void
*/
public function testHttpCodes() {
@@ -1158,7 +1158,7 @@ public function corsData() {
/**
* testFileNotFound
*
* @expectedException \Cake\Error\NotFoundException
* @expectedException InvalidArgumentException
* @return void
*/
public function testFileNotFound() {
@@ -1169,7 +1169,7 @@ public function testFileNotFound() {
/**
* test file with ..
*
* @expectedException Cake\Error\NotFoundException
* @expectedException InvalidArgumentException
* @return void
*/
public function testFileWithPathTraversal() {

0 comments on commit 512d385

Please sign in to comment.
You can’t perform that action at this time.