Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility issue with DoctrineModule 5.2.0 #263

Merged
merged 2 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"ext-mongodb": "*",
"container-interop/container-interop": "^1.2.0",
"doctrine/doctrine-module": "^5.0.0",
"doctrine/doctrine-module": "^5.0.0 <5.2.0",
Ocramius marked this conversation as resolved.
Show resolved Hide resolved
"doctrine/doctrine-laminas-hydrator": "^2.2.1 || ^3.0.0",
"doctrine/event-manager": "^1.1.1",
"doctrine/mongodb-odm": "^2.3.0",
Expand Down
5 changes: 0 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@ services:
- ./docker/php.ini:/usr/local/etc/php/php.ini
depends_on:
- mongodb
environment:
- TRAVIS
- TRAVIS_JOB_ID
- TRAVIS_BRANCH
- TRAVIS_PULL_REQUEST
mongodb:
image: mongo:latest
19 changes: 10 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
ARG PHP_VERSION=7.2
ARG PHP_VERSION=7.4
FROM php:${PHP_VERSION}-alpine

ARG XDEBUG=0

COPY docker/entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/entrypoint.sh

RUN apk add --no-cache \
autoconf \
Expand All @@ -18,13 +17,15 @@ RUN apk add --no-cache \
libxml2-dev \
make \
openssl-dev

RUN docker-php-ext-configure intl
RUN docker-php-ext-install -j$(nproc) intl
RUN pecl install mongodb
RUN set -o pipefail && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN if [ ${XDEBUG} == "1" ] ; then pecl install xdebug && docker-php-ext-enable xdebug ; fi
RUN composer config --global "platform.ext-mongo" "1.6.16"

RUN chmod 755 /usr/local/bin/entrypoint.sh \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) intl \
&& pecl install mongodb \
&& set -o pipefail \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& if [ ${XDEBUG} == "1" ] ; then pecl install xdebug && docker-php-ext-enable xdebug ; fi \
&& composer config --global "platform.ext-mongo" "1.6.16"

WORKDIR /docker
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
3 changes: 2 additions & 1 deletion tests/Assets/CustomRepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Repository\RepositoryFactory;
use Doctrine\Persistence\ObjectRepository;
use stdClass;

class CustomRepositoryFactory implements RepositoryFactory
{
Expand Down Expand Up @@ -57,7 +58,7 @@ public function findOneBy(array $criteria): ?object

public function getClassName(): string
{
return '';
return stdClass::class;
}
};
}
Expand Down
8 changes: 5 additions & 3 deletions tests/testing.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace DoctrineMongoODMModuleTest;

use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;

use function getenv;

return [
Expand All @@ -20,10 +22,10 @@
],
'driver' => [
'odm_default' => [
'drivers' => ['DoctrineMongoODMModuleTest\Assets\Document' => 'test'],
'drivers' => ['DoctrineMongoODMModuleTest\Assets\Document' => 'test_assets'],
],
'test' => [
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
'test_assets' => [
'class' => AnnotationDriver::class,
'cache' => 'array',
'paths' => [__DIR__ . '/Assets/Document'],
],
Expand Down