Skip to content

Commit 219d9fe

Browse files
committed
Bump up PHP version constraint.
Signed-off-by: ADmad <[email protected]>
1 parent 177f655 commit 219d9fe

12 files changed

+48
-34
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/phpunit.xml
77
/test/TestAsset/.cache/
88
/vendor/
9+
.phpunit.result.cache

.travis.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,28 @@ env:
1313
matrix:
1414
fast_finish: true
1515
include:
16-
- php: 7.1
17-
env:
18-
- DEPS=lowest
19-
- php: 7.1
20-
env:
21-
- DEPS=latest
22-
- CS_CHECK=true
23-
- TEST_COVERAGE=true
24-
- php: 7.2
25-
env:
26-
- DEPS=lowest
27-
- php: 7.2
28-
env:
29-
- DEPS=latest
3016
- php: 7.3
3117
env:
3218
- DEPS=lowest
3319
- php: 7.3
3420
env:
3521
- DEPS=latest
22+
- CS_CHECK=true
23+
- TEST_COVERAGE=true
3624
- php: 7.4
3725
env:
3826
- DEPS=lowest
3927
- php: 7.4
4028
env:
4129
- DEPS=latest
30+
- php: 'nightly'
31+
env:
32+
- DEPS=latest
4233

4334
before_install:
44-
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
35+
- if [[ $TEST_COVERAGE != 'true' && $TRAVIS_PHP_VERSION != 'nightly' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
4536

4637
install:
47-
- travis_retry composer install $COMPOSER_ARGS
4838
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
4939
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
5040
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
},
3030
"require": {
31-
"php": "^7.1",
31+
"php": "^7.3 || ^8.0",
3232
"laminas/laminas-zendframework-bridge": "^1.0",
3333
"psr/http-factory": "^1.0",
3434
"psr/http-message": "^1.0"
@@ -38,10 +38,11 @@
3838
"ext-dom": "*",
3939
"ext-gd": "*",
4040
"ext-libxml": "*",
41-
"http-interop/http-factory-tests": "^0.5.0",
41+
"http-interop/http-factory-tests": "^0.7.0",
4242
"laminas/laminas-coding-standard": "~1.0.0",
43-
"php-http/psr7-integration-tests": "^1.0",
44-
"phpunit/phpunit": "^7.5.18"
43+
"php-http/psr7-integration-tests": "^1.1",
44+
"phpspec/prophecy-phpunit": "^2.0",
45+
"phpunit/phpunit": "^9.1"
4546
},
4647
"provide": {
4748
"psr/http-factory-implementation": "1.0",

test/RelativeStreamTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Laminas\Diactoros\Stream;
1515
use PHPUnit\Framework\TestCase;
1616
use Prophecy\Argument;
17+
use Prophecy\PhpUnit\ProphecyTrait;
1718
use RuntimeException;
1819

1920
use const SEEK_SET;
@@ -23,6 +24,8 @@
2324
*/
2425
class RelativeStreamTest extends TestCase
2526
{
27+
use ProphecyTrait;
28+
2629
public function testToString()
2730
{
2831
$decorated = $this->prophesize(Stream::class);

test/Request/SerializerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function testSerializesRequestWithBody()
5454
->withBody($stream);
5555

5656
$message = Serializer::toString($request);
57-
$this->assertContains("POST /foo/bar HTTP/1.1\r\n", $message);
58-
$this->assertContains("\r\n\r\n" . $body, $message);
57+
$this->assertStringContainsString("POST /foo/bar HTTP/1.1\r\n", $message);
58+
$this->assertStringContainsString("\r\n\r\n" . $body, $message);
5959
}
6060

6161
public function testSerializesMultipleHeadersCorrectly()
@@ -67,8 +67,8 @@ public function testSerializesMultipleHeadersCorrectly()
6767
->withAddedHeader('X-Foo-Bar', 'Bat');
6868

6969
$message = Serializer::toString($request);
70-
$this->assertContains("X-Foo-Bar: Baz", $message);
71-
$this->assertContains("X-Foo-Bar: Bat", $message);
70+
$this->assertStringContainsString("X-Foo-Bar: Baz", $message);
71+
$this->assertStringContainsString("X-Foo-Bar: Bat", $message);
7272
}
7373

7474
public function originForms()

test/RequestTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public function testGetHeadersContainsHostHeaderIfUriWithHostIsPresent()
342342
$request = new Request('http://example.com');
343343
$headers = $request->getHeaders();
344344
$this->assertArrayHasKey('Host', $headers);
345-
$this->assertContains('example.com', $headers['Host']);
345+
$this->assertStringContainsString('example.com', $headers['Host'][0]);
346346
}
347347

348348
/**
@@ -421,7 +421,7 @@ public function testGetHostHeaderLineReturnsUriHostWhenPresent()
421421
{
422422
$request = new Request('http://example.com');
423423
$header = $request->getHeaderLine('host');
424-
$this->assertContains('example.com', $header);
424+
$this->assertStringContainsString('example.com', $header);
425425
}
426426

427427
/**

test/Response/HtmlResponseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
use Laminas\Diactoros\Response\HtmlResponse;
1515
use PHPUnit\Framework\TestCase;
1616
use Psr\Http\Message\StreamInterface;
17+
use Prophecy\PhpUnit\ProphecyTrait;
1718

1819
class HtmlResponseTest extends TestCase
1920
{
21+
use ProphecyTrait;
22+
2023
public function testConstructorAcceptsHtmlString()
2124
{
2225
$body = '<html>Uh oh not found</html>';

test/Response/JsonResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testUsesSaneDefaultJsonEncodingFlags($value, $key)
128128
$contents = (string) $stream;
129129

130130
$expected = json_encode($value, $defaultFlags);
131-
$this->assertContains(
131+
$this->assertStringContainsString(
132132
$expected,
133133
$contents,
134134
sprintf('Did not encode %s properly; expected (%s), received (%s)', $key, $expected, $contents)

test/Response/SerializerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public function testSerializesMultipleHeadersCorrectly()
5656
->withAddedHeader('X-Foo-Bar', 'Bat');
5757

5858
$message = Serializer::toString($response);
59-
$this->assertContains("X-Foo-Bar: Baz", $message);
60-
$this->assertContains("X-Foo-Bar: Bat", $message);
59+
$this->assertStringContainsString("X-Foo-Bar: Baz", $message);
60+
$this->assertStringContainsString("X-Foo-Bar: Bat", $message);
6161
}
6262

6363
public function testOmitsReasonPhraseFromStatusLineIfEmpty()
@@ -68,7 +68,7 @@ public function testOmitsReasonPhraseFromStatusLineIfEmpty()
6868
$response->getBody()->write('Content!');
6969

7070
$message = Serializer::toString($response);
71-
$this->assertContains("HTTP/1.1 299\r\n", $message);
71+
$this->assertStringContainsString("HTTP/1.1 299\r\n", $message);
7272
}
7373

7474
public function testCanDeserializeBasicResponse()

test/Response/TextResponseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
use Laminas\Diactoros\Response\TextResponse;
1515
use PHPUnit\Framework\TestCase;
1616
use Psr\Http\Message\StreamInterface;
17+
use Prophecy\PhpUnit\ProphecyTrait;
1718

1819
class TextResponseTest extends TestCase
1920
{
21+
use ProphecyTrait;
22+
2023
public function testConstructorAcceptsBodyAsString()
2124
{
2225
$body = 'Uh oh not found';

0 commit comments

Comments
 (0)