Skip to content

Commit

Permalink
Merge pull request #291 from driehle/phpunit10
Browse files Browse the repository at this point in the history
Upgraded from PHPUnit 9 to 10
  • Loading branch information
driehle authored Dec 29, 2024
2 parents ea07364 + 7249a22 commit b287401
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.phpcs.cache
/.phpunit.result.cache
/.phpunit.cache/
/build/
/config/application.config.php
/coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"laminas/laminas-session": "^2.22.1",
"phpspec/prophecy-phpunit": "^2.3.0",
"phpstan/phpstan": "^1.12.13",
"phpunit/phpunit": "^9.6.22"
"phpunit/phpunit": "^10.5.40"
},
"suggest": {
"laminas/laminas-developer-tools": "laminas-developer-tools if you want to profile operations executed by the ODM during development",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: .
dockerfile: docker/Dockerfile
args:
- PHP_VERSION=${PHP_VERSION:-8.0}
- PHP_VERSION=${PHP_VERSION:-8.1}
- XDEBUG=${XDEBUG:-0}
volumes:
- ./:/docker
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PHP_VERSION=8.0
ARG PHP_VERSION=8.1
FROM php:${PHP_VERSION}-alpine

ARG XDEBUG=0
Expand Down
2 changes: 1 addition & 1 deletion docs/en/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To change docker to a different php version

.. code:: bash
docker-compose build --build-arg PHP_VERSION=8.0
docker-compose build --build-arg PHP_VERSION=8.1
then run the unit tests as

Expand Down
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
stopOnFailure="false">
cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="DoctrineMongoODMModule Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/AbstractTest.php → tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use MongoDB\Driver\WriteConcern;
use PHPUnit\Framework\TestCase;

abstract class AbstractTest extends TestCase
abstract class AbstractTestCase extends TestCase
{
protected mixed $application;

Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/AuthenticationAdapterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace DoctrineMongoODMModuleTest\Doctrine;

use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;

class AuthenticationAdapterFactoryTest extends AbstractTest
class AuthenticationAdapterFactoryTest extends AbstractTestCase
{
public function testAuthenticationAdapterFactory(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/AuthenticationServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace DoctrineMongoODMModuleTest\Doctrine;

use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;

class AuthenticationServiceFactoryTest extends AbstractTest
class AuthenticationServiceFactoryTest extends AbstractTestCase
{
public function testAuthenticationServiceFactory(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/AuthenticationStorageFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace DoctrineMongoODMModuleTest\Doctrine;

use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;

class AuthenticationStorageFactoryTest extends AbstractTest
class AuthenticationStorageFactoryTest extends AbstractTestCase
{
public function testAuthenticationStorageFactory(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/ConfigurationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Doctrine\ODM\MongoDB\Types\Type;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use DoctrineMongoODMModule\Service\ConfigurationFactory;
use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;
use DoctrineMongoODMModuleTest\Assets\CustomClassMetadataFactory;
use DoctrineMongoODMModuleTest\Assets\CustomDocumentRepository;
use DoctrineMongoODMModuleTest\Assets\CustomRepositoryFactory;
Expand All @@ -22,7 +22,7 @@

use function assert;

final class ConfigurationFactoryTest extends AbstractTest
final class ConfigurationFactoryTest extends AbstractTestCase
{
public function testCreation(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/ConnectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use Doctrine\ODM\MongoDB\Configuration;
use DoctrineMongoODMModule\Service\ConnectionFactory;
use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;
use MongoDB\Client;

/** @covers \DoctrineMongoODMModule\Service\ConnectionFactory */
class ConnectionFactoryTest extends AbstractTest
class ConnectionFactoryTest extends AbstractTestCase
{
/** @var mixed[] $configuration */
private array $configuration;
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/CustomDefaultRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace DoctrineMongoODMModuleTest\Doctrine;

use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;
use DoctrineMongoODMModuleTest\Assets\CustomDocumentRepository;
use DoctrineMongoODMModuleTest\Assets\Document\Simple;

use function assert;

final class CustomDefaultRepositoryTest extends AbstractTest
final class CustomDefaultRepositoryTest extends AbstractTestCase
{
public function testCustomDefaultRepository(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/DocumentManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace DoctrineMongoODMModuleTest\Doctrine;

use Doctrine\ODM\MongoDB\DocumentManager;
use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;

final class DocumentManagerTest extends AbstractTest
final class DocumentManagerTest extends AbstractTestCase
{
/** @var mixed[] $configuration */
private array $configuration = [];
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/MongoLoggerCollectorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use DoctrineMongoODMModule\Collector\MongoLoggerCollector;
use DoctrineMongoODMModule\Service\MongoLoggerCollectorFactory;
use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;

class MongoLoggerCollectorFactoryTest extends AbstractTest
class MongoLoggerCollectorFactoryTest extends AbstractTestCase
{
public function testCreateService(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/PersistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace DoctrineMongoODMModuleTest\Doctrine;

use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\AbstractTestCase;
use DoctrineMongoODMModuleTest\Assets\Document\Simple;

class PersistTest extends AbstractTest
class PersistTest extends AbstractTestCase
{
public function testPersist(): void
{
Expand Down

0 comments on commit b287401

Please sign in to comment.