diff --git a/Containerfile b/Containerfile index 51f0222..d57b734 100644 --- a/Containerfile +++ b/Containerfile @@ -4,4 +4,4 @@ WORKDIR /code COPY --from=composer:2 /usr/bin/composer /usr/bin/composer COPY ./ /code -RUN composer install \ No newline at end of file +RUN composer install diff --git a/Makefile b/Makefile index b5199a3..e8eec65 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ PHP = docker compose run php +.PHONY: composer_install composer_update static_analysis tests + composer_install: @$(PHP) composer install @@ -8,3 +10,7 @@ composer_update: static_analysis: @$(PHP) vendor/bin/psalm + +tests: + @$(PHP) rm -rf var/cache + @$(PHP) vendor/bin/phpunit diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml deleted file mode 100644 index 8bd8ffd..0000000 --- a/config/packages/doctrine.yaml +++ /dev/null @@ -1,5 +0,0 @@ -doctrine: - orm: - dql: - string_functions: - match: DoctrineExtensions\Query\Mysql\MatchAgainst diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index e8f8e0c..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - ./tests/ - - - - - ./src - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..60cb564 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + ./src + + + + + + + + + + + ./tests + + + diff --git a/src/DependencyInjection/PcmSearchExtension.php b/src/DependencyInjection/PcmSearchExtension.php index f9721fe..ba9215a 100644 --- a/src/DependencyInjection/PcmSearchExtension.php +++ b/src/DependencyInjection/PcmSearchExtension.php @@ -6,11 +6,28 @@ namespace Pcm\SearchBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -class PcmSearchExtension extends Extension +class PcmSearchExtension extends Extension implements PrependExtensionInterface { + public function prepend(ContainerBuilder $container) + { + $container->loadFromExtension( + 'doctrine', + [ + 'orm' => [ + 'dql' => [ + 'string_functions' => [ + 'match' => 'DoctrineExtensions\Query\Mysql\MatchAgainst' + ] + ] + ] + ] + ); + } + public function load(array $configs, ContainerBuilder $container) { $loader = new YamlFileLoader( @@ -18,6 +35,5 @@ class PcmSearchExtension extends Extension new FileLocator(__DIR__.'/../../config') ); $loader->load('services.yaml'); - $loader->load('packages/doctrine.yaml'); } }