Skip to content

Commit 99e028c

Browse files
authored
Merge pull request #6 from niden-code/1.x-84
Adjusments to run Atlas.Statement with PHP 8.4
2 parents 1e66dcb + e653324 commit 99e028c

File tree

8 files changed

+109
-13
lines changed

8 files changed

+109
-13
lines changed

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Atlas.Statement CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
- '**.txt'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- '**.txt'
12+
workflow_dispatch:
13+
14+
env:
15+
fail-fast: true
16+
17+
# PHP extensions required by Composer
18+
EXTENSIONS: pdo
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
25+
# # PHPStan
26+
# quality:
27+
# name: "Validate Quality"
28+
# if: "!contains(github.event.head_commit.message, 'ci skip')"
29+
#
30+
# permissions:
31+
# contents: read
32+
#
33+
# runs-on: ubuntu-22.04
34+
#
35+
# strategy:
36+
# fail-fast: true
37+
# matrix:
38+
# php:
39+
# - '8.0'
40+
# - '8.1'
41+
# - '8.2'
42+
# - '8.3'
43+
# - '8.4'
44+
# steps:
45+
# - uses: actions/checkout@v4
46+
#
47+
# - name: "Setup PHP"
48+
# uses: shivammathur/setup-php@2.35.3
49+
# with:
50+
# php-version: ${{ matrix.php }}
51+
# extensions: ${{ env.EXTENSIONS }}
52+
# env:
53+
# COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
#
55+
# - name: "Install development dependencies with Composer"
56+
# uses: "ramsey/composer-install@v3"
57+
# with:
58+
# composer-options: "--prefer-dist"
59+
#
60+
# - name: "PHPStan"
61+
# run: |
62+
# composer stan
63+
64+
unit-tests:
65+
# needs: quality
66+
67+
permissions:
68+
contents: read # to fetch code (actions/checkout)
69+
70+
name: Unit tests / PHP-${{ matrix.php }}
71+
runs-on: ubuntu-22.04
72+
73+
strategy:
74+
matrix:
75+
php:
76+
- '8.0'
77+
- '8.1'
78+
- '8.2'
79+
- '8.3'
80+
- '8.4'
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: "Setup PHP"
85+
uses: shivammathur/setup-php@2.35.3
86+
with:
87+
php-version: ${{ matrix.php }}
88+
extensions: ${{ env.EXTENSIONS }}
89+
env:
90+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
- name: "Install development dependencies with Composer"
93+
uses: "ramsey/composer-install@v3"
94+
with:
95+
composer-options: "--prefer-dist"
96+
97+
- name: "Run Unit Tests"
98+
if: always()
99+
run: |
100+
composer test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/composer.lock
22
/vendor
33
/.phpunit.result.cache
4+
.bash_history
5+
.composer

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/DeleteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use PDO;
1212

13-
class DeleteTest extends StatementTest
13+
class DeleteTest extends StatementTestCase
1414
{
1515
public function testCommon()
1616
{

tests/InsertTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use PDO;
1212

13-
class InsertTest extends StatementTest
13+
class InsertTest extends StatementTestCase
1414
{
1515
public function testCommon()
1616
{

tests/SelectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use PDO;
1212
use Atlas\Statement\Driver\FakeDriver;
1313

14-
class SelectTest extends StatementTest
14+
class SelectTest extends StatementTestCase
1515
{
1616
public function testDistinct()
1717
{
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
namespace Atlas\Statement;
1010

1111
use PDO;
12+
use PHPUnit\Framework\TestCase;
1213
use ReflectionClass;
1314
use Atlas\Statement\Driver\FakeDriver;
1415

15-
abstract class StatementTest extends \PHPUnit\Framework\TestCase
16+
abstract class StatementTestCase extends TestCase
1617
{
1718
protected $statement;
1819

@@ -23,7 +24,7 @@ protected function setUp() : void
2324
$rc = new ReflectionClass(Bind::CLASS);
2425
$rp = $rc->getProperty('instanceCount');
2526
$rp->setAccessible(true);
26-
$rp->setValue(0);
27+
$rp->setValue(null, 0);
2728

2829
$this->statement = $this->newStatement();
2930
}

tests/UpdateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use PDO;
1212

13-
class UpdateTest extends StatementTest
13+
class UpdateTest extends StatementTestCase
1414
{
1515
public function testCommon()
1616
{

0 commit comments

Comments
 (0)