Skip to content
Open
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
10 changes: 9 additions & 1 deletion .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3' ]
sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
dependencies: [ 'default' ]
exclude:
- php-version: '8.1'
Expand All @@ -51,6 +51,14 @@ jobs:
sf-version: '7.2'
- php-version: '8.1'
sf-version: '7.3'
- php-version: '8.1'
sf-version: '7.4'
- php-version: '8.1'
sf-version: '8.0'
- php-version: '8.2'
sf-version: '8.0'
- php-version: '8.3'
sf-version: '8.0'
include:
- php-version: '8.4'
sf-version: '6.4'
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3' ]
sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
dependencies: [ 'default' ]
exclude:
- php-version: '8.1'
Expand All @@ -37,6 +37,14 @@ jobs:
sf-version: '7.2'
- php-version: '8.1'
sf-version: '7.3'
- php-version: '8.1'
sf-version: '7.4'
- php-version: '8.1'
sf-version: '8.0'
- php-version: '8.2'
sf-version: '8.0'
- php-version: '8.3'
sf-version: '8.0'
include:
- php-version: '8.4'
sf-version: '6.4'
Expand Down Expand Up @@ -110,7 +118,6 @@ jobs:

- name: PHPStan
run: |
vendor/bin/simple-phpunit --version
composer phpstan

yaml-lint:
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM php:8.0-fpm as php
FROM php:8.5-fpm as php

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1

RUN apt-get update && apt-get install -y \
libfcgi0ldbl \
zlib1g-dev \
gettext \
libzip-dev \
unzip \
git
libfcgi0ldbl \
zlib1g-dev \
gettext \
libzip-dev \
unzip \
git

RUN docker-php-ext-install zip

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Say goodbye to server deployment and manual updates with [Meilisearch Cloud](htt

## 📝 Requirements

* **Require** PHP 7.4 and later.
* **Compatible** with Symfony 5.4 and later.
* **Require** PHP 8.1 and later.
* **Compatible** with Symfony 6.4 and later.

For support of older versions, see older versions of this bundle.

Expand Down
38 changes: 18 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,34 @@
"php": "^8.1",
"ext-json": "*",
"meilisearch/meilisearch-php": "^1.16",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
"symfony/serializer": "^6.4 || ^7.0"
"symfony/config": "^6.4 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0",
"symfony/event-dispatcher": "^6.4 || ^7.0 || ^8.0",
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0",
"symfony/property-access": "^6.4 || ^7.0 || ^8.0",
"symfony/serializer": "^6.4 || ^7.0 || ^8.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.10 || ^3.0",
"doctrine/orm": "^2.12 || ^3.0",
"matthiasnoback/symfony-config-test": "^4.3 || ^5.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.1",
"matthiasnoback/symfony-config-test": "^6.1",
"matthiasnoback/symfony-dependency-injection-test": "^6.2",
"nikic/php-parser": "^5.6.2",
"nyholm/psr7": "^1.8.2",
"php-cs-fixer/shim": "^3.90.0",
"phpmd/phpmd": "^2.15",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.32",
"phpstan/phpstan-doctrine": "^2.0.11",
"phpstan/phpstan-phpunit": "^2.0.8",
"phpstan/phpstan-symfony": "^2.0.8",
"phpunit/php-code-coverage": "^9.2.32",
"symfony/doctrine-bridge": "^6.4 || ^7.0",
"symfony/filesystem": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-client": "^6.4.15 || ^7.1.8",
"symfony/phpunit-bridge": "^7.3",
"symfony/yaml": "^6.4 || ^7.0",
"symfony/var-exporter": "^6.4 || ^7.0"
"phpunit/php-code-coverage": "^10.1.16",
"phpunit/phpunit": "^10.5.60",
"symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0",
"symfony/filesystem": "^6.4 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0",
"symfony/http-client": "^6.4.15 || ^7.1.8 || ^8.0",
"symfony/yaml": "^6.4 || ^7.0 || ^8.0",
"symfony/var-exporter": "^6.4 || ^7.0 || ^8.0"
},
"autoload": {
"psr-4": {
Expand All @@ -69,10 +68,9 @@
}
},
"scripts": {
"phpmd": "./vendor/bin/phpmd src text phpmd.xml",
"phpstan": "./vendor/bin/phpstan",
"test:unit": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/simple-phpunit --colors=always --verbose",
"test:unit:coverage": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' XDEBUG_MODE=coverage ./vendor/bin/simple-phpunit --colors=always --coverage-html=tests/coverage",
"test:unit": "./vendor/bin/phpunit --colors=always",
"test:unit:coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --coverage-html=tests/coverage",
"lint:check": "./vendor/bin/php-cs-fixer fix -v --using-cache=no --dry-run",
"lint:fix": "./vendor/bin/php-cs-fixer fix -v --using-cache=no"
}
Expand Down
2 changes: 0 additions & 2 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ includes:
- phpstan-baseline.php

parameters:
bootstrapFiles:
- vendor/bin/.phpunit/phpunit/vendor/autoload.php
level: 5
paths:
- src
Expand Down
26 changes: 19 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="tests/bootstrap.php"
convertDeprecationsToExceptions="false"
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit/phpunit.xsd">
<coverage>
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit/phpunit.xsd"
displayDetailsOnIncompleteTests="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="false"
failOnNotice="true"
failOnWarning="true"
failOnRisky="true">
<source
ignoreSuppressionOfDeprecations="true"
restrictNotices="true"
restrictWarnings="true">
<include>
<directory>src/</directory>
</include>
</coverage>
</source>
<php>
<env name="KERNEL_CLASS" value="Meilisearch\Bundle\Tests\Kernel"/>
<env name="APP_ENV" value="test"/>
<env name="APP_DEBUG" value="false"/>
<env name="MEILISEARCH_PREFIX" value="sf_phpunit_"/>
<env name="MEILISEARCH_URL" value="http://127.0.0.1:7700"/>
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="9.6"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="10.5"/>
</php>
<testsuites>
<testsuite name="Integration">
<directory suffix=".php">tests/Integration</directory>
<directory suffix="Test.php">tests/Integration</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix=".php">tests/Unit</directory>
<directory suffix="Test.php">tests/Unit</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
Expand Down
5 changes: 0 additions & 5 deletions tests/Entity/ContentAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

namespace Meilisearch\Bundle\Tests\Entity;

use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Entity\Aggregator;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class ContentAggregator extends Aggregator
{
public function getIsVisible(): bool
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/DummyCustomGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
Expand Down
5 changes: 0 additions & 5 deletions tests/Entity/EmptyAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

namespace Meilisearch\Bundle\Tests\Entity;

use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Entity\Aggregator;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class EmptyAggregator extends Aggregator
{
}
2 changes: 1 addition & 1 deletion tests/Entity/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Meilisearch\Bundle\Tests\Entity\ObjectId\DummyObjectId;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

/**
* @ORM\Entity
Expand Down
7 changes: 3 additions & 4 deletions tests/Integration/Command/MeilisearchCreateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Meilisearch\Bundle\Tests\BaseKernelTestCase;
use Meilisearch\Bundle\Tests\Entity\DynamicSettings;
use PHPUnit\Framework\Attributes\TestWith;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;

Expand All @@ -29,10 +30,8 @@ public function testExecuteIndexCreation(): void
$this->assertSame($this->client->getTasks()->getResults()[0]['type'], 'indexCreation');
}

/**
* @testWith [false]
* [true]
*/
#[TestWith([false])]
#[TestWith([true])]
public function testWithoutIndices(bool $updateSettings): void
{
$createCommand = $this->application->find('meilisearch:create');
Expand Down
11 changes: 0 additions & 11 deletions tests/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\ORM\Mapping\LegacyReflectionFields;
use Meilisearch\Bundle\MeilisearchBundle;
use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
Expand Down Expand Up @@ -51,16 +50,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
]);
}

if (class_exists(EntityValueResolver::class)) {
$container->prependExtensionConfig('doctrine', [
'orm' => [
'controller_resolver' => [
'auto_mapping' => false,
],
],
]);
}

// @phpstan-ignore-next-line
if (Kernel::VERSION_ID >= 70300) {
$container->prependExtensionConfig('framework', [
Expand Down
12 changes: 4 additions & 8 deletions tests/Unit/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use Meilisearch\Bundle\DependencyInjection\Configuration;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

final class ConfigurationTest extends KernelTestCase
Expand All @@ -15,17 +16,14 @@ final class ConfigurationTest extends KernelTestCase
/**
* @param array<mixed> $inputConfig
* @param array<mixed> $expectedConfig
*
* @dataProvider dataTestConfigurationTree
*/
#[DataProvider('dataTestConfigurationTree')]
public function testValidConfig(array $inputConfig, array $expectedConfig): void
{
$this->assertProcessedConfigurationEquals($inputConfig, $expectedConfig);
}

/**
* @dataProvider dataTestSettingsDynamicCheckerInvalid
*/
#[DataProvider('dataTestSettingsDynamicCheckerInvalid')]
public function testSettingsDynamicCheckerInvalid(mixed $value): void
{
$this->assertConfigurationIsInvalid([
Expand All @@ -41,9 +39,7 @@ public function testSettingsDynamicCheckerInvalid(mixed $value): void
], 'Settings must be an array.');
}

/**
* @dataProvider dataTestSettingsDynamicCheckerValid
*/
#[DataProvider('dataTestSettingsDynamicCheckerValid')]
public function testSettingsDynamicCheckerValid(mixed $value): void
{
$this->assertConfigurationIsValid([
Expand Down
1 change: 0 additions & 1 deletion tests/config/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ doctrine:
dummy_object_id: Meilisearch\Bundle\Tests\Dbal\Type\DummyObjectIdType
orm:
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
Expand Down
1 change: 0 additions & 1 deletion tests/config/doctrine_old_proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ doctrine:
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
Expand Down
1 change: 0 additions & 1 deletion tests/config/doctrine_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ doctrine:
enable_native_lazy_objects: true
auto_generate_proxy_classes: false
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
Expand Down
Loading