File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,8 +237,12 @@ public function testDeleteRepository(): void
237237
238238 public function testDeleteNonExistingRepositoryFails (): void
239239 {
240- $ this ->expectException (\Exception::class);
241- $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
240+ try {
241+ $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
242+ $ this ->fail ('Expected exception not thrown ' );
243+ } catch (\Exception $ e ) {
244+ $ this ->assertGreaterThanOrEqual (400 , $ e ->getCode ());
245+ }
242246 }
243247
244248 public function testGetRepositoryName (): void
Original file line number Diff line number Diff line change @@ -1198,14 +1198,22 @@ public function testDeleteRepositoryTwiceFails(): void
11981198 $ this ->vcsAdapter ->createRepository (static ::$ owner , $ repositoryName , false );
11991199 $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
12001200
1201- $ this ->expectException (\Exception::class);
1202- $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
1201+ try {
1202+ $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
1203+ $ this ->fail ('Expected exception not thrown ' );
1204+ } catch (\Exception $ e ) {
1205+ $ this ->assertGreaterThanOrEqual (400 , $ e ->getCode ());
1206+ }
12031207 }
12041208
12051209 public function testDeleteNonExistingRepositoryFails (): void
12061210 {
1207- $ this ->expectException (\Exception::class);
1208- $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
1211+ try {
1212+ $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
1213+ $ this ->fail ('Expected exception not thrown ' );
1214+ } catch (\Exception $ e ) {
1215+ $ this ->assertGreaterThanOrEqual (400 , $ e ->getCode ());
1216+ }
12091217 }
12101218
12111219 public function testGetPullRequestFromBranchNoPR (): void
Original file line number Diff line number Diff line change @@ -1203,14 +1203,22 @@ public function testDeleteRepositoryTwiceFails(): void
12031203 $ this ->vcsAdapter ->createRepository (static ::$ owner , $ repositoryName , false );
12041204 $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
12051205
1206- $ this ->expectException (\Exception::class);
1207- $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
1206+ try {
1207+ $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
1208+ $ this ->fail ('Expected exception not thrown ' );
1209+ } catch (\Exception $ e ) {
1210+ $ this ->assertGreaterThanOrEqual (400 , $ e ->getCode ());
1211+ }
12081212 }
12091213
12101214 public function testDeleteNonExistingRepositoryFails (): void
12111215 {
1212- $ this ->expectException (\Exception::class);
1213- $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
1216+ try {
1217+ $ this ->vcsAdapter ->deleteRepository (static ::$ owner , 'non-existing-repo- ' . \uniqid ());
1218+ $ this ->fail ('Expected exception not thrown ' );
1219+ } catch (\Exception $ e ) {
1220+ $ this ->assertGreaterThanOrEqual (400 , $ e ->getCode ());
1221+ }
12141222 }
12151223
12161224 public function testGetOwnerName (): void
You can’t perform that action at this time.
0 commit comments