Skip to content

Commit

Permalink
Make sure CI is green (#159)
Browse files Browse the repository at this point in the history
* ci fixes

* minors

* cs

* fix

* Test that port can be zero

* Version fix
  • Loading branch information
Nyholm committed Nov 14, 2020
1 parent ed734c4 commit 66e6f49
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
composer update --no-interaction --prefer-dist --optimize-autoloader
- name: PHPStan
uses: docker://oskarstark/phpstan-ga:0.12.44
uses: docker://oskarstark/phpstan-ga:0.12.48
env:
REQUIRE_DEV: true
with:
entrypoint: /composer/vendor/bin/phpstan
args: analyze --no-progress
Expand All @@ -28,7 +30,7 @@ jobs:
uses: actions/checkout@v2

- name: PHP-CS-Fixer
uses: OskarStark/php-cs-fixer-ga@2.16.4.1
uses: OskarStark/php-cs-fixer-ga@2.16.4
with:
args: --dry-run --diff-format udiff

Expand All @@ -40,6 +42,8 @@ jobs:
uses: actions/checkout@v2

- name: Psalm
uses: psalm/psalm-github-actions@master
uses: docker://vimeo/psalm-github-actions:3.17.2
env:
REQUIRE_DEV: true
with:
args: --no-progress --show-info=false --stats
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require-dev": {
"phpunit/phpunit": "^7.5",
"php-http/psr7-integration-tests": "^1.0",
"http-interop/http-factory-tests": "dev-master",
"http-interop/http-factory-tests": "^0.8",
"symfony/error-handler": "^4.4"
},
"provide": {
Expand Down
14 changes: 12 additions & 2 deletions tests/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,22 @@ public function testWithPortCannotBeNegative()
(new Uri())->withPort(-1);
}

public function testParseUriPortCannotBeZero()
public function testParseUriPortCannotBeNegative()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Unable to parse URI');

new Uri('//example.com:0');
new Uri('//example.com:-1');
}

public function testParseUriPortCanBeZero()
{
if (version_compare(PHP_VERSION, '7.4.12') < 0) {
self::markTestSkipped('Skipping this on low PHP versions.');
}

$uri = new Uri('//example.com:0');
$this->assertEquals(0, $uri->getPort());
}

public function testSchemeMustHaveCorrectType()
Expand Down

0 comments on commit 66e6f49

Please sign in to comment.