Skip to content

Commit

Permalink
Merge pull request #40 from peter279k/test_enhancement
Browse files Browse the repository at this point in the history
Improve some testing stuffs
  • Loading branch information
freekmurze authored Dec 22, 2020
2 parents 3633de5 + 4df407d commit 56fdc77
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ jobs:
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
- name: Execute tests on Ubuntu OS
if: matrix.operating-system == 'ubuntu-latest'
run: XDEBUG_MODE=coverage vendor/bin/phpunit

- name: Execute tests on Windows OS
if: matrix.operating-system == 'windows-latest'
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build
composer.lock
docs
vendor
.phpunit.result.cache
6 changes: 3 additions & 3 deletions tests/QueryParameterBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function it_can_set_a_parameter()

$queryParameterBag->set('offset', 10);

$this->assertEquals(10, $queryParameterBag->get('offset'));
$this->assertSame('10', $queryParameterBag->get('offset'));
}

/** @test */
Expand All @@ -73,8 +73,8 @@ public function it_can_be_created_from_a_string()
{
$queryParameterBag = QueryParameterBag::fromString('offset=10&limit=20');

$this->assertEquals(10, $queryParameterBag->get('offset'));
$this->assertEquals(20, $queryParameterBag->get('limit'));
$this->assertSame('10', $queryParameterBag->get('offset'));
$this->assertSame('20', $queryParameterBag->get('limit'));
}

/** @test */
Expand Down
2 changes: 1 addition & 1 deletion tests/UrlBuildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function it_can_build_a_url_with_a_host()
{
$url = Url::create()->withHost('spatie.be');

$this->assertEquals('//spatie.be', $url);
$this->assertSame('//spatie.be', (string) $url);
}

/** @test */
Expand Down
2 changes: 1 addition & 1 deletion tests/UrlImmutableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function with_port_returns_a_new_instance()

$clone = $url->withPort(9000);

$this->assertEquals(0, $url->getPort());
$this->assertNull($url->getPort());
$this->assertEquals(9000, $clone->getPort());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/UrlQueryParametersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function it_can_get_a_query_parameter()
{
$url = Url::create()->withQuery('offset=10');

$this->assertEquals(10, $url->getQueryParameter('offset'));
$this->assertSame('10', $url->getQueryParameter('offset'));
}

/** @test */
Expand Down Expand Up @@ -44,7 +44,7 @@ public function it_can_set_a_query_parameter()
{
$url = Url::create()->withQueryParameter('offset', 10);

$this->assertEquals(10, $url->getQueryParameter('offset'));
$this->assertSame('10', $url->getQueryParameter('offset'));
}

/** @test */
Expand Down

0 comments on commit 56fdc77

Please sign in to comment.