3
0

7 Commits

Author SHA1 Message Date
361cd7baf8 Merge branch 'release/0.0.18' 2022-07-29 11:27:31 +01:00
6111bd07e5 Updating Doctrine settings 2022-07-29 11:27:21 +01:00
76ab724d1a Merge branch 'develop' of ssh://git.pcmdev.co.uk:2222/pcm-libraries/pcm-search-bundle into develop 2022-07-29 11:18:59 +01:00
d7a7d0b6e8 Merge tag '0.0.17' into develop
- Adding loader for doctrine.yaml to bring in MATCH AGAINST function
2022-07-29 11:18:49 +01:00
Brabli
709c641fc9 Migrate xml schema 2022-07-21 15:10:19 +01:00
Brabli
ff506e2aef Add tests command 2022-07-21 15:10:05 +01:00
Brabli
702fe24be4 Add space 2022-07-21 11:51:47 +01:00
6 changed files with 44 additions and 21 deletions

View File

@@ -4,4 +4,4 @@ WORKDIR /code
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY ./ /code
RUN composer install
RUN composer install

View File

@@ -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

View File

@@ -1,5 +0,0 @@
doctrine:
orm:
dql:
string_functions:
match: DoctrineExtensions\Query\Mysql\MatchAgainst

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
</phpunit>

19
phpunit.xml.dist Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="./vendor/autoload.php">
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="intl.default_locale" value="en"/>
<ini name="intl.error_level" value="0"/>
<ini name="memory_limit" value="-1"/>
</php>
<testsuites>
<testsuite name="Test suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -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');
}
}