diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81abefc21f5..93bccea102c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,13 +89,15 @@ Coverage will be available in `coverage/index.html`. The command to launch Behat tests is: - php -d memory_limit=-1 ./vendor/bin/behat --suite=default --stop-on-failure --format=progress + php -d memory_limit=-1 ./vendor/bin/behat --profile=default --stop-on-failure --format=progress If you want to launch Behat tests for MongoDB, the command is: - APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --suite=mongodb --stop-on-failure --format=progress + MONGODB_URL=mongodb://localhost:27017 APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --profile=mongodb --stop-on-failure --format=progress -To get more details about an error, replace `--format=progress` by `-vvv`. +To get more details about an error, replace `--format=progress` by `-vvv`. You may run a mongo instance using docker: + + docker run -p 27017:27017 mongo:latest # License and Copyright Attribution diff --git a/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php b/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php index d6887ad465a..3fee14977ce 100644 --- a/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php +++ b/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php @@ -160,7 +160,7 @@ protected function normalizeValues(array $values, string $property): ?array protected function hasValidValues(array $values, $type = null): bool { foreach ($values as $key => $value) { - if (self::DOCTRINE_INTEGER_TYPE === $type && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) { + if (\in_array($type, (array) self::DOCTRINE_INTEGER_TYPE, true) && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) { return false; } } diff --git a/src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php b/src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php index 7a5f8852bd4..91cb23dc3cf 100644 --- a/src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php +++ b/src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php @@ -41,7 +41,7 @@ final class SearchFilter extends AbstractFilter implements SearchFilterInterface { use SearchFilterTrait; - public const DOCTRINE_INTEGER_TYPE = MongoDbType::INTEGER; + public const DOCTRINE_INTEGER_TYPE = [MongoDbType::INTEGER, MongoDbType::INT]; public function __construct(ManagerRegistry $managerRegistry, IriConverterInterface $iriConverter, IdentifiersExtractorInterface $identifiersExtractor, PropertyAccessorInterface $propertyAccessor = null, LoggerInterface $logger = null, array $properties = null, NameConverterInterface $nameConverter = null) {