File tree Expand file tree Collapse file tree 7 files changed +21
-19
lines changed Expand file tree Collapse file tree 7 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 15
15
namespace Cake \Test \TestCase \Auth ;
16
16
17
17
use Cake \Auth \BasicAuthenticate ;
18
- use Cake \Error ;
18
+ use Cake \Network \ Exception \ UnauthorizedException ;
19
19
use Cake \Network \Request ;
20
20
use Cake \ORM \Entity ;
21
21
use Cake \ORM \TableRegistry ;
@@ -168,7 +168,7 @@ public function testAuthenticateChallenge() {
168
168
169
169
try {
170
170
$ this ->auth ->unauthenticated ($ request , $ this ->response );
171
- } catch (Error \ UnauthorizedException $ e ) {
171
+ } catch (UnauthorizedException $ e ) {
172
172
}
173
173
174
174
$ this ->assertNotEmpty ($ e );
@@ -205,7 +205,7 @@ public function testAuthenticateSuccess() {
205
205
/**
206
206
* test scope failure.
207
207
*
208
- * @expectedException \Cake\Error \UnauthorizedException
208
+ * @expectedException \Cake\Network\Exception \UnauthorizedException
209
209
* @expectedExceptionCode 401
210
210
* @return void
211
211
*/
Original file line number Diff line number Diff line change 17
17
namespace Cake \Test \TestCase \Auth ;
18
18
19
19
use Cake \Auth \DigestAuthenticate ;
20
- use Cake \Error ;
20
+ use Cake \Network \ Exception \ UnauthorizedException ;
21
21
use Cake \Network \Request ;
22
22
use Cake \ORM \Entity ;
23
23
use Cake \ORM \TableRegistry ;
@@ -93,7 +93,7 @@ public function testAuthenticateNoData() {
93
93
/**
94
94
* test the authenticate method
95
95
*
96
- * @expectedException \Cake\Error \UnauthorizedException
96
+ * @expectedException \Cake\Network\Exception \UnauthorizedException
97
97
* @expectedExceptionCode 401
98
98
* @return void
99
99
*/
@@ -131,7 +131,7 @@ public function testAuthenticateChallenge() {
131
131
132
132
try {
133
133
$ this ->auth ->unauthenticated ($ request , $ this ->response );
134
- } catch (Error \ UnauthorizedException $ e ) {
134
+ } catch (UnauthorizedException $ e ) {
135
135
}
136
136
137
137
$ this ->assertNotEmpty ($ e );
@@ -178,7 +178,7 @@ public function testAuthenticateSuccess() {
178
178
/**
179
179
* test scope failure.
180
180
*
181
- * @expectedException \Cake\Error \UnauthorizedException
181
+ * @expectedException \Cake\Network\Exception \UnauthorizedException
182
182
* @expectedExceptionCode 401
183
183
* @return void
184
184
*/
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ public function testConfig() {
87
87
'persistent ' => true ,
88
88
'password ' => false ,
89
89
'database ' => 0 ,
90
+ 'unix_socket ' => false
90
91
);
91
92
$ this ->assertEquals ($ expecting , $ config );
92
93
}
Original file line number Diff line number Diff line change 19
19
use Cake \Controller \Controller ;
20
20
use Cake \Core \App ;
21
21
use Cake \Core \Configure ;
22
- use Cake \Error ;
23
22
use Cake \Event \Event ;
23
+ use Cake \Network \Exception \ForbiddenException ;
24
+ use Cake \Network \Exception \UnauthorizedException ;
24
25
use Cake \Network \Request ;
25
26
use Cake \Network \Response ;
26
27
use Cake \Network \Session ;
@@ -789,7 +790,7 @@ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() {
789
790
/**
790
791
* Throw ForbiddenException if config `unauthorizedRedirect` is set to false
791
792
*
792
- * @expectedException \Cake\Error \ForbiddenException
793
+ * @expectedException \Cake\Network\Exception \ForbiddenException
793
794
* @return void
794
795
*/
795
796
public function testForbiddenException () {
@@ -1261,7 +1262,7 @@ public function testUser() {
1261
1262
/**
1262
1263
* testStatelessAuthNoRedirect method
1263
1264
*
1264
- * @expectedException \Cake\Error \UnauthorizedException
1265
+ * @expectedException \Cake\Network\Exception \UnauthorizedException
1265
1266
* @expectedExceptionCode 401
1266
1267
* @return void
1267
1268
*/
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public function testValidTokenInHeader($method) {
107
107
* Test that the X-CSRF-Token works with the various http methods.
108
108
*
109
109
* @dataProvider httpMethodProvider
110
- * @expectedException \Cake\Error \ForbiddenException
110
+ * @expectedException \Cake\Network\Exception \ForbiddenException
111
111
* @return void
112
112
*/
113
113
public function testInvalidTokenInHeader ($ method ) {
@@ -149,7 +149,7 @@ public function testValidTokenRequestData($method) {
149
149
* Test that request data works with the various http methods.
150
150
*
151
151
* @dataProvider httpMethodProvider
152
- * @expectedException \Cake\Error \ForbiddenException
152
+ * @expectedException \Cake\Network\Exception \ForbiddenException
153
153
* @return void
154
154
*/
155
155
public function testInvalidTokenRequestData ($ method ) {
Original file line number Diff line number Diff line change 19
19
use Cake \Controller \Controller ;
20
20
use Cake \Core \Configure ;
21
21
use Cake \Datasource \ConnectionManager ;
22
- use Cake \Error ;
22
+ use Cake \Network \ Exception \ NotFoundException ;
23
23
use Cake \Network \Request ;
24
24
use Cake \ORM \TableRegistry ;
25
25
use Cake \TestSuite \TestCase ;
@@ -472,7 +472,7 @@ public function testOutOfRangePageNumberGetsClamped() {
472
472
try {
473
473
$ this ->Paginator ->paginate ($ table );
474
474
$ this ->fail ('No exception raised ' );
475
- } catch (\ Cake \ Error \ NotFoundException $ e ) {
475
+ } catch (NotFoundException $ e ) {
476
476
$ this ->assertEquals (
477
477
1 ,
478
478
$ this ->request ->params ['paging ' ]['PaginatorPosts ' ]['page ' ],
@@ -484,7 +484,7 @@ public function testOutOfRangePageNumberGetsClamped() {
484
484
/**
485
485
* Test that a really REALLY large page number gets clamped to the max page size.
486
486
*
487
- * @expectedException \Cake\Error \NotFoundException
487
+ * @expectedException \Cake\Network\Exception \NotFoundException
488
488
* @return void
489
489
*/
490
490
public function testOutOfVeryBigPageNumberGetsClamped () {
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ public function testCharset() {
113
113
/**
114
114
* Tests the statusCode method
115
115
*
116
- * @expectedException \Cake\Core\Exception\Exception
116
+ * @expectedException InvalidArgumentException
117
117
* @return void
118
118
*/
119
119
public function testStatusCode () {
@@ -398,7 +398,7 @@ public function testCompress() {
398
398
/**
399
399
* Tests the httpCodes method
400
400
*
401
- * @expectedException \Cake\Core\Exception\Exception
401
+ * @expectedException InvalidArgumentException
402
402
* @return void
403
403
*/
404
404
public function testHttpCodes () {
@@ -1158,7 +1158,7 @@ public function corsData() {
1158
1158
/**
1159
1159
* testFileNotFound
1160
1160
*
1161
- * @expectedException \Cake\Error\NotFoundException
1161
+ * @expectedException InvalidArgumentException
1162
1162
* @return void
1163
1163
*/
1164
1164
public function testFileNotFound () {
@@ -1169,7 +1169,7 @@ public function testFileNotFound() {
1169
1169
/**
1170
1170
* test file with ..
1171
1171
*
1172
- * @expectedException Cake\Error\NotFoundException
1172
+ * @expectedException InvalidArgumentException
1173
1173
* @return void
1174
1174
*/
1175
1175
public function testFileWithPathTraversal () {
You can’t perform that action at this time.
0 commit comments