Skip to content

Commit

Permalink
Update phpunit to v8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvdvleuten committed Jun 25, 2020
1 parent e3d3663 commit 7feb8b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/.phpunit.result.cache
/composer.lock
/vendor/
.idea/
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"phpbench/phpbench": "^0.15",
"phpunit/phpunit": "^8.5",
"phpbench/phpbench": "^0.17",
"symfony/phpunit-bridge": "^5.1"
}
}
20 changes: 10 additions & 10 deletions tests/UlidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Ulid\Tests;

use PHPUnit\Framework\TestCase;
use Ulid\Exception\InvalidUlidStringException;
use Ulid\Ulid;

/**
Expand Down Expand Up @@ -79,21 +80,19 @@ public function testCreatesFromLowercaseString(): void
$this->assertEquals('01an4z07by79ka1307sr9x4mv3', (string) Ulid::fromString('01an4z07by79ka1307sr9x4mv3', true));
}

/**
* @expectedException \Ulid\Exception\InvalidUlidStringException
* @expectedExceptionMessage Invalid ULID string (wrong length):
*/
public function testCreatesFromStringWithInvalidUlid(): void
{
$this->expectException(InvalidUlidStringException::class);
$this->expectExceptionMessage('Invalid ULID string (wrong length):');

Ulid::fromString('not-a-valid-ulid');
}

/**
* @expectedException \Ulid\Exception\InvalidUlidStringException
* @expectedExceptionMessage Invalid ULID string (wrong length):
*/
public function testCreatesFromStringWithTrailingNewLine(): void
{
$this->expectException(InvalidUlidStringException::class);
$this->expectExceptionMessage('Invalid ULID string (wrong length):');

Ulid::fromString("01AN4Z07BY79KA1307SR9X4MV3\n");
}

Expand All @@ -109,11 +108,12 @@ public function invalidAlphabetDataProvider(): array

/**
* @dataProvider invalidAlphabetDataProvider
* @expectedException \Ulid\Exception\InvalidUlidStringException
* @expectedExceptionMessage Invalid ULID string (wrong characters):
*/
public function testCreatesFromStringWithInvalidAlphabet($ulid): void
{
$this->expectException(InvalidUlidStringException::class);
$this->expectExceptionMessage('Invalid ULID string (wrong characters):');

Ulid::fromString($ulid);
}

Expand Down

0 comments on commit 7feb8b1

Please sign in to comment.