Skip to content

Commit 3cb7531

Browse files
authored
Merge pull request #87 from php-db/refactor-sql-abstraction
Refactor sql abstraction
2 parents f04262b + ffcf5e4 commit 3cb7531

File tree

244 files changed

+12345
-6998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+12345
-6998
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/.phpunit.result.cache
33
/.phpstan-cache
44
/phpstan.neon
5+
/phpbench.json
56
/clover.xml
67
/coveralls-upload.json
78
/phpunit.xml

.gitignore copy

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

.laminas-ci.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extensions": [
33
"pdo-sqlite",
4-
"sqlite3",
5-
"sqlsrv"
4+
"sqlite3"
65
],
76
"additional_checks": [
87
{
@@ -14,4 +13,4 @@
1413
}
1514
}
1615
]
17-
}
16+
}

.laminas-ci/phpunit.xml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
bootstrap="vendor/autoload.php"
66
colors="true">
7-
<coverage processUncoveredFiles="true">
8-
<include>
9-
<directory suffix=".php">./src</directory>
10-
</include>
11-
<exclude>
12-
<file>./src/Sql/Ddl/Column/Float.php</file>
13-
</exclude>
14-
</coverage>
7+
8+
<extensions>
9+
<bootstrap class="PhpDbIntegrationTest\Extension\ListenerExtension" />
10+
</extensions>
1511

1612
<testsuites>
1713
<testsuite name="unit test">
1814
<directory>./test/unit</directory>
15+
<exclude>./test/unit/Adapter/AdapterAbstractServiceFactoryTest.php</exclude>
16+
<exclude>./test/unit/Adapter/AdapterServiceFactoryTest.php</exclude>
17+
<exclude>./test/unit/Adapter/AdapterServiceDelegatorTest.php</exclude>
18+
<exclude>./test/unit/Adapter/Driver/Pdo/PdoTest.php</exclude>
19+
<exclude>./test/unit/Adapter/Driver/Pdo/ConnectionTest.php</exclude>
20+
<exclude>./test/unit/Adapter/Driver/Pdo/ConnectionIntegrationTest.php</exclude>
21+
<exclude>./test/unit/Adapter/Driver/Pdo/StatementTest.php</exclude>
22+
<exclude>./test/unit/Adapter/Driver/Pdo/StatementIntegrationTest.php</exclude>
23+
<exclude>./test/unit/Adapter/AdapterTest.php</exclude>
24+
<exclude>./test/unit/Adapter/AdapterAwareTraitTest.php</exclude>
25+
<exclude>./test/unit/TableGateway</exclude>
26+
<exclude>./test/unit/RowGateway</exclude>
27+
<exclude>./test/unit/ConfigProviderTest.php</exclude>
1928
</testsuite>
2029
<testsuite name="integration test">
2130
<directory>./test/integration</directory>
2231
</testsuite>
2332
</testsuites>
2433

25-
<listeners>
26-
<listener class="PhpDbIntegrationTest\IntegrationTestListener" file="./test/integration/IntegrationTestListener.php"/>
27-
</listeners>
28-
2934
<php>
3035
<!-- Integration Test Variables -->
3136
<env name="TESTS_PHPDB_ADAPTER_DRIVER_MYSQL" value="true" />
@@ -34,7 +39,7 @@
3439
<env name="TESTS_PHPDB_ADAPTER_DRIVER_MYSQL_PASSWORD" value="password" />
3540
<env name="TESTS_PHPDB_ADAPTER_DRIVER_MYSQL_DATABASE" value="laminasdb_test" />
3641

37-
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV" value="true" />
42+
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV" value="false" />
3843
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV_HOSTNAME" value="mssql" />
3944
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV_USERNAME" value="sa" />
4045
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV_PASSWORD" value="Password123" />
@@ -52,7 +57,7 @@
5257
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_IBMDB2_PASSWORD" value="" />
5358
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_IBMDB2_DATABASE" value="" />
5459

55-
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL" value="true" />
60+
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL" value="false" />
5661
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL_HOSTNAME" value="postgres" />
5762
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL_USERNAME" value="gha" />
5863
<env name="TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL_PASSWORD" value="password" />

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ The `phpunit.xml.dist` file defines two test suites, "unit test" and "integratio
2222
You can run one or the other using the `--testsuite` option to `phpunit`:
2323

2424
```bash
25-
$ ./vendor/bin/phpunit --testsuite "unit test" # unit tests only
26-
$ ./vendor/bin/phpunit --testsuite "integration test" # integration tests only
25+
./vendor/bin/phpunit --testsuite "unit test" # unit tests only
26+
./vendor/bin/phpunit --testsuite "integration test" # integration tests only
2727
```
2828

2929
Unit tests do not require additional functionality beyond having the appropriate database extensions present and loaded in your PHP binary.
@@ -36,13 +36,13 @@ So, the repository includes a [Docker Compose][docker-compose] configuration whi
3636
To start up the configuration, run the following command:
3737

3838
```bash
39-
$ docker compose up -d
39+
docker compose up -d
4040
```
4141

4242
To test that the environment is up and running, run the following command:
4343

4444
```bash
45-
$ docker compose ps
45+
docker compose ps
4646
```
4747

4848
You should see output similar to the following:
@@ -65,16 +65,16 @@ So, copy `phpunit.xml.dist` to `phpunit.xml`, and change the following environme
6565
From there, you can run the integration tests by running the following command:
6666

6767
```bash
68-
$ docker compose exec php composer test-integration
68+
docker compose exec php composer test-integration
6969
```
7070

7171
> [!TIP]
7272
> If you want to grow your Docker Compose knowledge, grab a (free) copy of [Deploy with Docker Compose][deploy-with-docker-compose].
7373
7474
-----
7575

76-
- File issues at https://github.com/php-db/phpdb/issues
77-
- Documentation is at https://docs.php-db.dev
76+
- File issues at <https://github.com/php-db/phpdb/issues>
77+
- Documentation is at <https://docs.php-db.dev>
7878

7979
[docker-compose]: https://docs.docker.com/compose/intro/features-uses/
80-
[deploy-with-docker-compose]: https://deploywithdockercompose.com
80+
[deploy-with-docker-compose]: https://deploywithdockercompose.com

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"laminas/laminas-coding-standard": "^3.0.1",
3838
"laminas/laminas-eventmanager": "^3.14.0",
3939
"laminas/laminas-hydrator": "^4.6.0",
40+
"phpbench/phpbench": "^1.4",
4041
"phpstan/phpstan": "^2.1",
4142
"phpstan/phpstan-phpunit": "^2.0",
4243
"phpunit/phpunit": "^11.5.15",
@@ -55,7 +56,8 @@
5556
"autoload-dev": {
5657
"psr-4": {
5758
"PhpDbTest\\": "test/unit/",
58-
"PhpDbIntegrationTest\\": "test/integration/"
59+
"PhpDbIntegrationTest\\": "test/integration/",
60+
"PhpDbBenchmark\\": "test/benchmark/"
5961
}
6062
},
6163
"scripts": {

0 commit comments

Comments
 (0)