diff --git a/.gitignore b/.gitignore index 8baec61..39b71b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /.phpcs.cache -/.phpunit.result.cache +/.phpunit.cache/ /build/ /config/application.config.php /coverage.xml diff --git a/composer.json b/composer.json index 420cd42..b892a47 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/docker-compose.yml b/docker-compose.yml index beeba62..92acdc0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docker/Dockerfile b/docker/Dockerfile index 9cc4439..1101a51 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG PHP_VERSION=8.0 +ARG PHP_VERSION=8.1 FROM php:${PHP_VERSION}-alpine ARG XDEBUG=0 diff --git a/docs/en/development.rst b/docs/en/development.rst index a120d73..90d5b29 100644 --- a/docs/en/development.rst +++ b/docs/en/development.rst @@ -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 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 761719a..ab782cf 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,17 @@ + cacheDirectory=".phpunit.cache"> ./tests + + + ./src + + diff --git a/tests/AbstractTest.php b/tests/AbstractTestCase.php similarity index 96% rename from tests/AbstractTest.php rename to tests/AbstractTestCase.php index fd8c0a9..7e5265a 100644 --- a/tests/AbstractTest.php +++ b/tests/AbstractTestCase.php @@ -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; diff --git a/tests/Doctrine/AuthenticationAdapterFactoryTest.php b/tests/Doctrine/AuthenticationAdapterFactoryTest.php index d674c41..2e0a435 100644 --- a/tests/Doctrine/AuthenticationAdapterFactoryTest.php +++ b/tests/Doctrine/AuthenticationAdapterFactoryTest.php @@ -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 { diff --git a/tests/Doctrine/AuthenticationServiceFactoryTest.php b/tests/Doctrine/AuthenticationServiceFactoryTest.php index 24c86f0..e35984b 100644 --- a/tests/Doctrine/AuthenticationServiceFactoryTest.php +++ b/tests/Doctrine/AuthenticationServiceFactoryTest.php @@ -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 { diff --git a/tests/Doctrine/AuthenticationStorageFactoryTest.php b/tests/Doctrine/AuthenticationStorageFactoryTest.php index c7268bc..4d973e3 100644 --- a/tests/Doctrine/AuthenticationStorageFactoryTest.php +++ b/tests/Doctrine/AuthenticationStorageFactoryTest.php @@ -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 { diff --git a/tests/Doctrine/ConfigurationFactoryTest.php b/tests/Doctrine/ConfigurationFactoryTest.php index 4182688..295f777 100644 --- a/tests/Doctrine/ConfigurationFactoryTest.php +++ b/tests/Doctrine/ConfigurationFactoryTest.php @@ -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; @@ -22,7 +22,7 @@ use function assert; -final class ConfigurationFactoryTest extends AbstractTest +final class ConfigurationFactoryTest extends AbstractTestCase { public function testCreation(): void { diff --git a/tests/Doctrine/ConnectionFactoryTest.php b/tests/Doctrine/ConnectionFactoryTest.php index 1b010fa..3dfcbd6 100644 --- a/tests/Doctrine/ConnectionFactoryTest.php +++ b/tests/Doctrine/ConnectionFactoryTest.php @@ -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; diff --git a/tests/Doctrine/CustomDefaultRepositoryTest.php b/tests/Doctrine/CustomDefaultRepositoryTest.php index 5ab6e1d..994f1fb 100644 --- a/tests/Doctrine/CustomDefaultRepositoryTest.php +++ b/tests/Doctrine/CustomDefaultRepositoryTest.php @@ -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 { diff --git a/tests/Doctrine/DocumentManagerTest.php b/tests/Doctrine/DocumentManagerTest.php index c9a369a..04cf6cd 100644 --- a/tests/Doctrine/DocumentManagerTest.php +++ b/tests/Doctrine/DocumentManagerTest.php @@ -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 = []; diff --git a/tests/Doctrine/MongoLoggerCollectorFactoryTest.php b/tests/Doctrine/MongoLoggerCollectorFactoryTest.php index bc9b0dc..d0a45d7 100644 --- a/tests/Doctrine/MongoLoggerCollectorFactoryTest.php +++ b/tests/Doctrine/MongoLoggerCollectorFactoryTest.php @@ -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 { diff --git a/tests/Doctrine/PersistTest.php b/tests/Doctrine/PersistTest.php index 4516b73..6a2553b 100644 --- a/tests/Doctrine/PersistTest.php +++ b/tests/Doctrine/PersistTest.php @@ -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 {