@@ -88,7 +88,7 @@ public function testRoleRegistryRemoveOneNonExistent()
88
88
$ this ->_acl ->removeRole ('nonexistent ' );
89
89
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon removing a non-existent Role ' );
90
90
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
91
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
91
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
92
92
}
93
93
}
94
94
@@ -112,7 +112,7 @@ public function testRoleRegistryAddInheritsNonExistent()
112
112
$ this ->_acl ->addRole (new Zend_Acl_Role ('guest ' ), 'nonexistent ' );
113
113
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent parent ' );
114
114
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
115
- $ this ->assertContains ('does not exist ' , $ e ->getMessage ());
115
+ $ this ->assertStringContainsString ('does not exist ' , $ e ->getMessage ());
116
116
}
117
117
}
118
118
@@ -128,14 +128,14 @@ public function testRoleRegistryInheritsNonExistent()
128
128
$ this ->_acl ->inheritsRole ('nonexistent ' , $ roleGuest );
129
129
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent child Role ' );
130
130
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
131
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
131
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
132
132
}
133
133
134
134
try {
135
135
$ this ->_acl ->inheritsRole ($ roleGuest , 'nonexistent ' );
136
136
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon specifying a non-existent parent Role ' );
137
137
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
138
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
138
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
139
139
}
140
140
}
141
141
@@ -210,7 +210,7 @@ public function testRoleRegistryDuplicate()
210
210
->add ($ roleGuest );
211
211
$ this ->fail ('Expected exception not thrown upon adding same Role twice ' );
212
212
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
213
- $ this ->assertContains ('already exists ' , $ e ->getMessage ());
213
+ $ this ->assertStringContainsString ('already exists ' , $ e ->getMessage ());
214
214
}
215
215
}
216
216
@@ -228,7 +228,7 @@ public function testRoleRegistryDuplicateId()
228
228
->add ($ roleGuest2 );
229
229
$ this ->fail ('Expected exception not thrown upon adding two Roles with same ID ' );
230
230
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
231
- $ this ->assertContains ('already exists ' , $ e ->getMessage ());
231
+ $ this ->assertStringContainsString ('already exists ' , $ e ->getMessage ());
232
232
}
233
233
}
234
234
@@ -291,7 +291,7 @@ public function testResourceRemoveOneNonExistent()
291
291
$ this ->_acl ->remove ('nonexistent ' );
292
292
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon removing a non-existent Resource ' );
293
293
} catch (Zend_Acl_Exception $ e ) {
294
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
294
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
295
295
}
296
296
}
297
297
@@ -315,7 +315,7 @@ public function testResourceAddInheritsNonExistent()
315
315
$ this ->_acl ->add (new Zend_Acl_Resource ('area ' ), 'nonexistent ' );
316
316
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon specifying a non-existent parent ' );
317
317
} catch (Zend_Acl_Exception $ e ) {
318
- $ this ->assertContains ('does not exist ' , $ e ->getMessage ());
318
+ $ this ->assertStringContainsString ('does not exist ' , $ e ->getMessage ());
319
319
}
320
320
}
321
321
@@ -331,14 +331,14 @@ public function testResourceInheritsNonExistent()
331
331
$ this ->_acl ->inherits ('nonexistent ' , $ resourceArea );
332
332
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon specifying a non-existent child Resource ' );
333
333
} catch (Zend_Acl_Exception $ e ) {
334
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
334
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
335
335
}
336
336
337
337
try {
338
338
$ this ->_acl ->inherits ($ resourceArea , 'nonexistent ' );
339
339
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon specifying a non-existent parent Resource ' );
340
340
} catch (Zend_Acl_Exception $ e ) {
341
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
341
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
342
342
}
343
343
}
344
344
@@ -374,7 +374,7 @@ public function testResourceDuplicate()
374
374
->add ($ resourceArea );
375
375
$ this ->fail ('Expected exception not thrown upon adding same Resource twice ' );
376
376
} catch (Zend_Acl_Exception $ e ) {
377
- $ this ->assertContains ('already exists ' , $ e ->getMessage ());
377
+ $ this ->assertStringContainsString ('already exists ' , $ e ->getMessage ());
378
378
}
379
379
}
380
380
@@ -390,7 +390,7 @@ public function testResourceDuplicateId()
390
390
->add ($ resourceArea2 );
391
391
$ this ->fail ('Expected exception not thrown upon adding two Resources with same ID ' );
392
392
} catch (Zend_Acl_Exception $ e ) {
393
- $ this ->assertContains ('already exists ' , $ e ->getMessage ());
393
+ $ this ->assertStringContainsString ('already exists ' , $ e ->getMessage ());
394
394
}
395
395
}
396
396
@@ -403,14 +403,14 @@ public function testIsAllowedNonExistent()
403
403
$ this ->_acl ->isAllowed ('nonexistent ' );
404
404
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon non-existent Role ' );
405
405
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
406
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
406
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
407
407
}
408
408
409
409
try {
410
410
$ this ->_acl ->isAllowed (null , 'nonexistent ' );
411
411
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon non-existent Resource ' );
412
412
} catch (Zend_Acl_Exception $ e ) {
413
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
413
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
414
414
}
415
415
}
416
416
@@ -719,7 +719,7 @@ public function testRuleRoleRemove()
719
719
$ this ->_acl ->isAllowed ('guest ' );
720
720
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon isAllowed() on non-existent Role ' );
721
721
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
722
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
722
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
723
723
}
724
724
$ this ->_acl ->addRole (new Zend_Acl_Role ('guest ' ));
725
725
$ this ->assertFalse ($ this ->_acl ->isAllowed ('guest ' ));
@@ -739,7 +739,7 @@ public function testRuleRoleRemoveAll()
739
739
$ this ->_acl ->isAllowed ('guest ' );
740
740
$ this ->fail ('Expected Zend_Acl_Role_Registry_Exception not thrown upon isAllowed() on non-existent Role ' );
741
741
} catch (Zend_Acl_Role_Registry_Exception $ e ) {
742
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
742
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
743
743
}
744
744
$ this ->_acl ->addRole (new Zend_Acl_Role ('guest ' ));
745
745
$ this ->assertFalse ($ this ->_acl ->isAllowed ('guest ' ));
@@ -759,7 +759,7 @@ public function testRulesResourceRemove()
759
759
$ this ->_acl ->isAllowed (null , 'area ' );
760
760
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon isAllowed() on non-existent Resource ' );
761
761
} catch (Zend_Acl_Exception $ e ) {
762
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
762
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
763
763
}
764
764
$ this ->_acl ->add (new Zend_Acl_Resource ('area ' ));
765
765
$ this ->assertFalse ($ this ->_acl ->isAllowed (null , 'area ' ));
@@ -779,7 +779,7 @@ public function testRulesResourceRemoveAll()
779
779
$ this ->_acl ->isAllowed (null , 'area ' );
780
780
$ this ->fail ('Expected Zend_Acl_Exception not thrown upon isAllowed() on non-existent Resource ' );
781
781
} catch (Zend_Acl_Exception $ e ) {
782
- $ this ->assertContains ('not found ' , $ e ->getMessage ());
782
+ $ this ->assertStringContainsString ('not found ' , $ e ->getMessage ());
783
783
}
784
784
$ this ->_acl ->add (new Zend_Acl_Resource ('area ' ));
785
785
$ this ->assertFalse ($ this ->_acl ->isAllowed (null , 'area ' ));
@@ -1076,11 +1076,11 @@ protected function _loadUseCase1()
1076
1076
/**
1077
1077
* Returns an array of registered roles.
1078
1078
*
1079
- * @expectedException \PHPUnit\Framework\Exception
1080
1079
* @group ZF-5638
1081
1080
*/
1082
1081
public function testGetRegisteredRoles ()
1083
1082
{
1083
+ $ this ->expectException (\PHPUnit \Framework \Exception::class);
1084
1084
$ acl = $ this ->_acl ;
1085
1085
$ acl ->addRole ('developer ' );
1086
1086
@@ -1165,13 +1165,13 @@ public function testGetRegisteredRolesIsDeprecated()
1165
1165
try {
1166
1166
$ this ->_acl ->getRegisteredRoles ();
1167
1167
$ this ->fail ('getRegisteredRoles() did not throw an exception ' );
1168
- } catch (\PHPUnit \Framework \Exception $ e ) {
1168
+ } catch (\PHPUnit \Framework \Exception ) {
1169
1169
self ::assertTrue (true );
1170
1170
1171
1171
return ;
1172
1172
}
1173
1173
1174
- $ this -> fail ('An expected notice has not been raised ' );
1174
+ static :: fail ('An expected notice has not been raised ' );
1175
1175
}
1176
1176
1177
1177
/**
0 commit comments