Skip to content

Commit a07db90

Browse files
committed
Upgrade PHPUnit
1 parent 58964b1 commit a07db90

File tree

6 files changed

+132
-209
lines changed

6 files changed

+132
-209
lines changed

composer.json

+15-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"ext-intl": "*"
4444
},
4545
"require-dev" : {
46-
"phpunit/phpunit": "^8.5.8",
46+
"phpunit/phpunit": "^9.5",
4747
"php-coveralls/php-coveralls": "^2.1",
48-
"wa72/simplelogger" : "^1.0",
48+
"wa72/simplelogger": "^1.0",
4949
"friendsofphp/php-cs-fixer": "^2.16.4",
5050
"symfony/process": "^3 || ^4 || ^5",
5151
"thecodingmachine/tdbm-fluid-schema-builder": "^1.0.0",
@@ -71,12 +71,21 @@
7171
"scripts": {
7272
"phpstan": "php -d memory_limit=3G vendor/bin/phpstan analyse src -c phpstan.neon --no-progress -vvv",
7373
"require-checker": "composer-require-checker check --config-file=composer-require-checker.json",
74-
"test": "phpunit",
74+
"test": "XDEBUG_MODE=coverage phpunit",
7575
"csfix": "php-cs-fixer fix src/ && php-cs-fixer fix tests/",
7676
"cscheck": "php-cs-fixer fix src/ --dry-run --stop-on-violation && php-cs-fixer fix tests/ --dry-run --stop-on-violation ",
77-
"ci": ["@cscheck", "@phpstan", "@test", "@require-checker"],
78-
"post-install-cmd": ["@composer bin all install --ansi"],
79-
"post-update-cmd": ["@composer bin all update --ansi"]
77+
"ci": [
78+
"@cscheck",
79+
"@phpstan",
80+
"@test",
81+
"@require-checker"
82+
],
83+
"post-install-cmd": [
84+
"@composer bin all install --ansi"
85+
],
86+
"post-update-cmd": [
87+
"@composer bin all update --ansi"
88+
]
8089
},
8190
"extra": {
8291
"branch-alias": {

phpunit.xml.dist

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
66
backupGlobals="false"
77
backupStaticAttributes="false"
88
colors="true"
@@ -21,25 +21,25 @@
2121

2222
<php>
2323
<!-- "Real" test database -->
24-
<var name="db_host" value="localhost" />
25-
<var name="db_username" value="root" />
26-
<var name="db_password" value="" />
27-
<var name="db_name" value="tdbm_testcase" />
24+
<var name="db_host" value="localhost"/>
25+
<var name="db_username" value="root"/>
26+
<var name="db_password" value=""/>
27+
<var name="db_name" value="tdbm_testcase"/>
2828
<var name="db_port" value="3306"/>
2929
<var name="db_driver" value="pdo_mysql"/>
3030
</php>
3131

32-
<filter>
33-
<whitelist processUncoveredFilesFromWhitelist="true">
34-
<directory suffix=".php">src/</directory>
35-
<exclude>
36-
<directory suffix=".php">src/Test</directory>
37-
<file>src/Schema/LockFileSchemaManager.php</file>
38-
</exclude>
39-
</whitelist>
40-
</filter>
41-
<logging>
42-
<log type="coverage-html" target="build/coverage"/>
43-
<log type="coverage-clover" target="build/logs/clover.xml"/>
44-
</logging>
32+
<coverage processUncoveredFiles="true">
33+
<include>
34+
<directory suffix=".php">src/</directory>
35+
</include>
36+
<exclude>
37+
<directory suffix=".php">src/Test</directory>
38+
<file>src/Schema/LockFileSchemaManager.php</file>
39+
</exclude>
40+
<report>
41+
<clover outputFile="build/logs/clover.xml"/>
42+
<html outputDirectory="build/coverage"/>
43+
</report>
44+
</coverage>
4545
</phpunit>

tests/TDBMDaoGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function testDaoGeneration(): void
149149

150150
$this->tdbmDaoGenerator->generateAllDaosAndBeans();
151151

152-
$this->assertFileNotExists($dummyFile);
152+
$this->assertFileDoesNotExist($dummyFile);
153153

154154
//Check that the lock file was generated
155155
$this->assertFileExists($schemaFilePath);

tests/TDBMServiceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ public function testBuildFilterFromFilterBagIterator(): void
836836
$tdbmService = new TDBMService(new Configuration('TheCodingMachine\\TDBM\\Test\\Dao\\Bean', 'TheCodingMachine\\TDBM\\Test\\Dao', self::getConnection(), $this->getNamingStrategy(), null, null, new NullLogger()));
837837

838838
[$sql, $parameters, $counter] = $tdbmService->buildFilterFromFilterBag(new \ArrayIterator(['id' => 1]), self::getConnection()->getDatabasePlatform());
839-
$this->assertRegExp('/\(.id. = :tdbmparam1\)/', $sql);
839+
$this->assertMatchesRegularExpression('/\(.id. = :tdbmparam1\)/', $sql);
840840
$this->assertEquals($parameters['tdbmparam1'], 1);
841841
}
842842

0 commit comments

Comments
 (0)