Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@v4

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## Unreleased

- Explicitly nullable params in test helpers.
- Test last insert IDs with omitted and null names.
- Upgrade PHPStan to 1.0.
- Add PHP 8.5 to Github workflow.

## 2.0.0

Initial release.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"require-dev": {
"pds/skeleton": "^1.0",
"phpunit/phpunit": "~9.0",
"phpstan/phpstan": "^0.12.82"
"phpstan/phpstan": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion tests/FakeConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function perform(string $statement, array $values = []) : PDOStatement
return new PDOStatement();
}

public function lastInsertId(string $name = null) : string
public function lastInsertId(?string $name = null) : string
{
return "{$name}-1";
}
Expand Down
14 changes: 14 additions & 0 deletions tests/InsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,18 @@ public function testGetLastInsertId()
$actual = $query->getLastInsertId('foo');
$this->assertSame('foo-1', $actual);
}

public function testGetLastInsertId_withoutName()
{
$query = $this->newQuery();
$actual = $query->getLastInsertId();
$this->assertSame('-1', $actual);
}

public function testGetLastInsertId_withNullName()
{
$query = $this->newQuery();
$actual = $query->getLastInsertId(null);
$this->assertSame('-1', $actual);
}
}
2 changes: 1 addition & 1 deletion tests/QueryTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function getQueryClass()
return substr(get_class($this), 0, -4);
}

protected function newQuery(string $arg = null)
protected function newQuery(?string $arg = null)
{
if ($arg === null) {
$arg = new FakeConnection('fake');
Expand Down
Loading