Skip to content

Commit e715d39

Browse files
authored
Merge pull request #31 from SimonFrings/windows
Run tests on Windows with PHPUnit
2 parents 45870fd + 845f853 commit e715d39

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ on:
66

77
jobs:
88
PHPUnit:
9-
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-20.04
9+
name: PHPUnit (PHP ${{ matrix.php }} on ${{ matrix.os }})
10+
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13+
os:
14+
- ubuntu-20.04
15+
- windows-2019
1316
php:
1417
- 8.0
1518
- 7.4

tests/AppTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ public function testLogRequestResponsePrintsRequestLogWithCurrentDateAndTime()
970970
$app = new App();
971971

972972
// 2021-01-29 12:22:01.717 127.0.0.1 "GET /users HTTP/1.1" 200 6\n
973-
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} 127\.0\.0\.1 \"GET \/users HTTP\/1\.1\" 200 6\n$/");
973+
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} 127\.0\.0\.1 \"GET \/users HTTP\/1\.1\" 200 6" . PHP_EOL . "$/");
974974

975975
$request = new ServerRequest('GET', 'http://localhost:8080/users', [], '', '1.1', ['REMOTE_ADDR' => '127.0.0.1']);
976976
$response = new Response(200, [], "Hello\n");
@@ -986,7 +986,7 @@ public function testLogRequestResponseWithoutRemoteAddressPrintsRequestLogWithDa
986986
$app = new App();
987987

988988
// 2021-01-29 12:22:01.717 - "GET /users HTTP/1.1" 200 6\n
989-
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} - \"GET \/users HTTP\/1\.1\" 200 6\n$/");
989+
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} - \"GET \/users HTTP\/1\.1\" 200 6" . PHP_EOL . "$/");
990990

991991
$request = new ServerRequest('GET', 'http://localhost:8080/users');
992992
$response = new Response(200, [], "Hello\n");
@@ -1002,7 +1002,7 @@ public function testLogPrintsMessageWithCurrentDateAndTime()
10021002
$app = new App();
10031003

10041004
// 2021-01-29 12:22:01.717 Hello\n
1005-
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} Hello\n$/");
1005+
$this->expectOutputRegex("/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3} Hello" . PHP_EOL . "$/");
10061006

10071007
// $app->log('Hello');
10081008
$ref = new ReflectionMethod($app, 'log');

0 commit comments

Comments
 (0)