From 815cee5bac62b994e25b459981f5b0d2632ab659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haso=C5=88?= Date: Mon, 13 May 2013 04:46:20 +0200 Subject: [PATCH] [FrameworkBundle] Added missing files for phpunit --- .../FrameworkExtensionTest.php | 15 ++++++---- .../Tests/Functional/app/AppKernel.php | 5 ++++ .../Bundle/FrameworkBundle/composer.json | 15 ++++++---- .../Bundle/FrameworkBundle/phpunit.xml.dist | 30 +++++++++++++++++++ 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 172c95f57f..5d17d1d6f9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -172,20 +172,22 @@ abstract class FrameworkExtensionTest extends TestCase } } - $rootDirectory = str_replace('/', DIRECTORY_SEPARATOR, realpath(__DIR__.'/../../../../..').'/'); - $files = array_map(function($resource) use ($rootDirectory, $resources) { return str_replace($rootDirectory, '', realpath($resource[1])); }, $resources); + $files = array_map(function($resource) { return realpath($resource[1]); }, $resources); + $ref = new \ReflectionClass('Symfony\Component\Validator\Validator'); $this->assertContains( - str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Validator/Resources/translations/validators.en.xlf'), + strtr(dirname($ref->getFileName()) . '/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Validator translation resources' ); + $ref = new \ReflectionClass('Symfony\Component\Form\Form'); $this->assertContains( - str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Form/Resources/translations/validators.en.xlf'), + strtr(dirname($ref->getFileName()) . '/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Form translation resources' ); + $ref = new \ReflectionClass('Symfony\Component\Security\Core\SecurityContext'); $this->assertContains( - str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Security/Resources/translations/security.en.xlf'), + strtr(dirname(dirname($ref->getFileName())) . '/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Security translation resources' ); @@ -213,8 +215,9 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertTrue($container->hasDefinition('validator.mapping.loader.yaml_files_loader'), '->registerValidationConfiguration() defines the YAML loader'); $xmlFiles = $container->getParameter('validator.mapping.loader.xml_files_loader.mapping_files'); + $ref = new \ReflectionClass('Symfony\Component\Form\Form'); $this->assertContains( - realpath(__DIR__.'/../../../../Component/Form/Resources/config/validation.xml'), + realpath(dirname($ref->getFileName()).'/Resources/config/validation.xml'), array_map('realpath', $xmlFiles), '->registerValidationConfiguration() adds Form validation.xml to XML loader' ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php index 655c9c74e9..caf2fd8f12 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php @@ -27,6 +27,11 @@ while ($dir !== $lastDir) { break; } + if (file_exists($dir.'/vendor/autoload.php')) { + require_once $dir.'/vendor/autoload.php'; + break; + } + $dir = dirname($dir); } diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 197a5e5935..daa1eee38b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -17,20 +17,23 @@ ], "require": { "php": ">=5.3.3", - "symfony/dependency-injection" : "~2.0", + "symfony/dependency-injection" : "~2.2", "symfony/config" : "~2.2", "symfony/event-dispatcher": "~2.1", - "symfony/http-kernel": "~2.2", - "symfony/filesystem": "~2.1", + "symfony/http-kernel": "~2.3", + "symfony/filesystem": "~2.3", "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.2", + "symfony/stopwatch": "~2.3", "symfony/templating": "~2.1", - "symfony/translation": "~2.2", + "symfony/translation": "~2.3", "doctrine/common": "~2.2" }, "require-dev": { "symfony/finder": "~2.0", - "symfony/security": "~2.2" + "symfony/security": "~2.3", + "symfony/form": "~2.3", + "symfony/class-loader": "~2.1", + "symfony/validator": "~2.1" }, "suggest": { "symfony/console": "", diff --git a/src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist b/src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist new file mode 100644 index 0000000000..663faf41e8 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + + ./Tests/ + + + + + + ./ + + ./vendor + ./Resources + ./Tests + + + +