Skip to content

Commit 66e6f49

Browse files
authored
Make sure CI is green (#159)
* ci fixes * minors * cs * fix * Test that port can be zero * Version fix
1 parent ed734c4 commit 66e6f49

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/static.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
composer update --no-interaction --prefer-dist --optimize-autoloader
1515
1616
- name: PHPStan
17-
uses: docker://oskarstark/phpstan-ga:0.12.44
17+
uses: docker://oskarstark/phpstan-ga:0.12.48
18+
env:
19+
REQUIRE_DEV: true
1820
with:
1921
entrypoint: /composer/vendor/bin/phpstan
2022
args: analyze --no-progress
@@ -28,7 +30,7 @@ jobs:
2830
uses: actions/checkout@v2
2931

3032
- name: PHP-CS-Fixer
31-
uses: OskarStark/[email protected].1
33+
uses: OskarStark/[email protected]
3234
with:
3335
args: --dry-run --diff-format udiff
3436

@@ -40,6 +42,8 @@ jobs:
4042
uses: actions/checkout@v2
4143

4244
- name: Psalm
43-
uses: psalm/psalm-github-actions@master
45+
uses: docker://vimeo/psalm-github-actions:3.17.2
46+
env:
47+
REQUIRE_DEV: true
4448
with:
4549
args: --no-progress --show-info=false --stats

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"require-dev": {
2424
"phpunit/phpunit": "^7.5",
2525
"php-http/psr7-integration-tests": "^1.0",
26-
"http-interop/http-factory-tests": "dev-master",
26+
"http-interop/http-factory-tests": "^0.8",
2727
"symfony/error-handler": "^4.4"
2828
},
2929
"provide": {

tests/UriTest.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,22 @@ public function testWithPortCannotBeNegative()
126126
(new Uri())->withPort(-1);
127127
}
128128

129-
public function testParseUriPortCannotBeZero()
129+
public function testParseUriPortCannotBeNegative()
130130
{
131131
$this->expectException(\InvalidArgumentException::class);
132132
$this->expectExceptionMessage('Unable to parse URI');
133133

134-
new Uri('//example.com:0');
134+
new Uri('//example.com:-1');
135+
}
136+
137+
public function testParseUriPortCanBeZero()
138+
{
139+
if (version_compare(PHP_VERSION, '7.4.12') < 0) {
140+
self::markTestSkipped('Skipping this on low PHP versions.');
141+
}
142+
143+
$uri = new Uri('//example.com:0');
144+
$this->assertEquals(0, $uri->getPort());
135145
}
136146

137147
public function testSchemeMustHaveCorrectType()

0 commit comments

Comments
 (0)