Explorar o código

[FrameworkBundle] Small changes to test setup.

Drak %!s(int64=13) %!d(string=hai) anos
pai
achega
ff0412a2bd

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php

@@ -18,7 +18,7 @@ class WebTestCase extends BaseWebTestCase
 {
     static public function assertRedirect($response, $location)
     {
-        self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.substr($response, 0, 2000));
+        self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode());
         self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
     }
 

+ 4 - 4
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php

@@ -17,12 +17,12 @@ $lastDir = null;
 while ($dir !== $lastDir) {
     $lastDir = $dir;
 
-    if (is_file($dir.'/autoload.php')) {
+    if (file_exists($dir.'/autoload.php')) {
         require_once $dir.'/autoload.php';
         break;
     }
 
-    if (is_file($dir.'/autoload.php.dist')) {
+    if (file_exists($dir.'/autoload.php.dist')) {
         require_once $dir.'/autoload.php.dist';
         break;
     }
@@ -52,7 +52,7 @@ class AppKernel extends Kernel
         $this->testCase = $testCase;
 
         $fs = new Filesystem();
-        if (!$fs->isAbsolutePath($rootConfig) && !is_file($rootConfig = __DIR__.'/'.$testCase.'/'.$rootConfig)) {
+        if (!$fs->isAbsolutePath($rootConfig) && !file_exists($rootConfig = __DIR__.'/'.$testCase.'/'.$rootConfig)) {
             throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig));
         }
         $this->rootConfig = $rootConfig;
@@ -62,7 +62,7 @@ class AppKernel extends Kernel
 
     public function registerBundles()
     {
-        if (!is_file($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) {
+        if (!file_exists($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) {
             throw new \RuntimeException(sprintf('The bundles file "%s" does not exist.', $filename));
         }
 

+ 2 - 0
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml

@@ -8,7 +8,9 @@ framework:
     form: ~
     test: ~
     session:
+        default_locale: en
         auto_start:     true
         storage_id:     session.storage.filesystem
+
 services:
     logger: { class: Symfony\Component\HttpKernel\Log\NullLogger }