Skip to content

Commit

Permalink
Bump PHPUnit to version 8
Browse files Browse the repository at this point in the history
- the earliest version that is currently supported and works with
  PHP7.4
- PHPUnit 8 no longer works with the upstream dbunit, which has
  been abandoned
- removed outdated config from tests/phpunit.xml in favour of
  default behaviour
- Replace phpunit/dbunit with a supported fork, misantron/dbunit
- Updated clases used, method signitures and documentation as
  needed due to that
  • Loading branch information
gregcorbett committed Sep 15, 2023
1 parent bef48a8 commit 78ea3c9
Show file tree
Hide file tree
Showing 44 changed files with 1,241 additions and 980 deletions.
4 changes: 2 additions & 2 deletions .github/actions/mysql_bootstrap_pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
/**
* Returns the database connection to your test databse.
* Modify as required to return a connection to your test db.
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @return PHPUnit\DbUnit\Database\Connection
*/
function getConnectionToTestDB() {
$pdo = new PDO('mysql:host=172.18.0.1;dbname=doctrine;charset=UTF8', 'user', 'password');
return new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdo);
return new PHPUnit\DbUnit\Database\DefaultConnection($pdo);
}
4 changes: 2 additions & 2 deletions .github/actions/sqlite_bootstrap_pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
/**
* Returns the database connection to your test databse.
* Modify as required to return a connection to your test db.
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @return PHPUnit\DbUnit\Database\DefaultConnection
*/
function getConnectionToTestDB() {
$sqliteFile = '/tmp/gocdb.sqlite';
$pdo = new PDO("sqlite:" . $sqliteFile);
return new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdo, 'sqlite');
return new PHPUnit\DbUnit\Database\DefaultConnection($pdo, 'sqlite');
}

?>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"doctrine/annotations": "*"
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
"phpunit/dbunit": ">=1.2",
"phpunit/phpunit": "8.*",
"misantron/dbunit": "*",
"phpmd/phpmd": "^2.13",
"squizlabs/php_codesniffer": "^3.7",
"taq/pdooci": "^1.0"
Expand Down
Loading

0 comments on commit 78ea3c9

Please sign in to comment.