From 15f89558b8fc1fe9cf07fd6b627b25326af974b5 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Tue, 4 Dec 2018 02:07:51 +0100 Subject: [PATCH 1/2] DevKit updates --- .flintci.yml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 7 +++---- tests/autoload.php.dist | 8 ++------ tests/bootstrap.php | 25 ++++++++++++++++++++++--- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.flintci.yml b/.flintci.yml index 332edf2d..8258ef2e 100644 --- a/.flintci.yml +++ b/.flintci.yml @@ -2,3 +2,4 @@ services: composernormalize: true phpcsfixer: true yamllint: true + xmllint: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 90829c0f..f621ba33 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,7 @@ +## Subject + + - -## Subject - - diff --git a/tests/autoload.php.dist b/tests/autoload.php.dist index a399bb92..cbba4048 100644 --- a/tests/autoload.php.dist +++ b/tests/autoload.php.dist @@ -2,19 +2,15 @@ // if the bundle is within a symfony project, try to reuse the project's autoload -$files = array( +$files = [ __DIR__.'/../vendor/autoload.php', - __DIR__.'/../../../../app/autoload.php', - __DIR__.'/../../../../apps/autoload.php', -); +]; $autoload = false; foreach ($files as $file) { if (is_file($file)) { $autoload = include_once $file; - echo "autoload: ".$file."\n"; - break; } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 202644fc..da772a77 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,13 +4,32 @@ * This file is part of the Sonata Project package. * * (c) Thomas Rabaix - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. +* +* For the full copyright and license information, please view the LICENSE +* file that was distributed with this source code. +*/ + +/* + * fix encoding issue while running text on different host with different locale configuration */ +setlocale(LC_ALL, 'en_US.UTF-8'); if (file_exists($file = __DIR__.'/autoload.php')) { require_once $file; } elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { require_once $file; } + +/* + * try to get Symfony's PHPUnit Bridge + */ +$files = array_filter([ + __DIR__.'/../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', + __DIR__.'/../vendor/symfony/phpunit-bridge/bootstrap.php', + __DIR__.'/../../../../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', + __DIR__.'/../../../../vendor/symfony/phpunit-bridge/bootstrap.php', +], 'file_exists'); + +if ($files) { + require_once current($files); +} From 12086c6fdee43a2485c6a6d0f4598646c4abcd55 Mon Sep 17 00:00:00 2001 From: Sullivan SENECHAL Date: Tue, 4 Dec 2018 02:08:09 +0100 Subject: [PATCH 2/2] Applied fixes from FlintCI --- tests/bootstrap.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index da772a77..f31b24fe 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,10 +4,10 @@ * This file is part of the Sonata Project package. * * (c) Thomas Rabaix -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ /* * fix encoding issue while running text on different host with different locale configuration