Skip to content

Commit

Permalink
test: cover newly introduced behavior in verification tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Jan 15, 2024
1 parent 9e14373 commit 0116f75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/mediawiki.verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ jobs:
- run: curl -L -s -N "http://site2.localhost:8001/w/api.php" | grep -q "Main module"
- run: curl -L -s -N "http://site2.localhost:8001/w/load.php" | grep -q "no modules were requested"
- run: curl -L -s -N "http://site2.localhost:8001/w/rest.php" | grep -q "did not match any known handler"

- run: curl -L -s -N "http://notfound.localhost:8001/wiki/Main_Page" | grep -q "It may never have existed"

- run: curl -L -s -N "http://failwith500.localhost:8001/wiki/Main_Page" | grep -q "server error in the platform API"
7 changes: 7 additions & 0 deletions docker-compose/fake-api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
// subdomain is 1 element
$subdomain = $matches[1];

if ( $subdomain === 'failwith500' ) {
http_response_code(500);
echo "Internal server error";
die(1);
}

$file = __DIR__ . '/WikiInfo-'.$subdomain.'.json';
if ( !file_exists($file) ) {
http_response_code(404);
echo 'Requested subdomain does not exist in test data';
die(1);
}
Expand Down

0 comments on commit 0116f75

Please sign in to comment.