Skip to content

Commit 47a7f80

Browse files
committed
Support for Codeception 5
1 parent e66eec9 commit 47a7f80

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: [7.1, 7.2, 7.3, 7.4, 8.0]
11+
php: [7.3, 7.4, 8.0]
1212

1313
steps:
1414
- name: Checkout code

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
],
1616
"minimum-stability": "RC",
1717
"require": {
18-
"php": "^7.1 || ^8.0",
19-
"guzzlehttp/guzzle": "^6.3|^7.0",
20-
"codeception/lib-innerbrowser": "^1.3",
18+
"php": "^7.3 || ^8.0",
19+
"guzzlehttp/guzzle": "^7.3",
20+
"codeception/lib-innerbrowser": "^1.5",
2121
"codeception/codeception": "*@dev"
2222
},
2323
"require-dev": {
24-
"codeception/module-rest": "^1.0"
24+
"codeception/module-rest": "^1.3"
2525
},
2626
"conflict": {
27-
"codeception/codeception": "<4.0"
27+
"codeception/codeception": "<4.1"
2828
},
2929
"suggest": {
3030
"codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests"

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A Codeception module for testing web application over HTTP.
99

1010
## Requirements
1111

12-
* `PHP 7.1` or higher.
12+
* `PHP 7.3` or higher.
1313

1414
## Installation
1515

src/Codeception/Lib/Connector/Guzzle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ protected function getAbsoluteUri($uri)
176176
if (strpos($uri, '://') === false && strpos($uri, '//') !== 0) {
177177
if (strpos($uri, '/') === 0) {
178178
$baseUriPath = $baseUri->getPath();
179-
if (!empty($baseUriPath) && strpos($uri, $baseUriPath) === 0) {
179+
if (!empty($baseUriPath) && strpos($uri, (string) $baseUriPath) === 0) {
180180
$uri = substr($uri, strlen($baseUriPath));
181181
}
182182

tests/data/rest/server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ function RESTServer()
1717
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
1818
$data = $_GET;
1919
} else if ($tmp = file_get_contents('php://input')) {
20-
$data = json_decode($tmp);
20+
$data = json_decode($tmp, null, 512, JSON_THROW_ON_ERROR);
2121
}
2222

2323
$response = call_user_func($callback, $data);
2424
if (is_scalar($response)) {
2525
print $response;
2626
return;
2727
}
28-
print json_encode($response);
28+
print json_encode($response, JSON_THROW_ON_ERROR);
2929
}
3030
}

tests/unit/Codeception/Module/PhpBrowserRestTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ public function testArrayJson()
133133
public function testSeeResponseContainsJsonFailsGracefullyWhenJsonResultIsNotArray()
134134
{
135135
$this->shouldFail();
136-
$this->setStubResponse(json_encode('no_status'));
136+
$this->setStubResponse(json_encode('no_status', JSON_THROW_ON_ERROR));
137137
$this->module->seeResponseContainsJson(array('id' => 1));
138138
}
139139

140140
public function testDontSeeResponseJsonMatchesJsonPathPassesWhenJsonResultIsNotArray()
141141
{
142-
$this->setStubResponse(json_encode('no_status'));
142+
$this->setStubResponse(json_encode('no_status', JSON_THROW_ON_ERROR));
143143
$this->module->dontSeeResponseJsonMatchesJsonPath('$.error');
144144
}
145145

0 commit comments

Comments
 (0)