Explorar el Código

[Routing] fixed unit tests for previous commit

Fabien Potencier hace 14 años
padre
commit
8d58826085

+ 1 - 1
src/Symfony/Component/Form/Extension/Core/Type/FileType.php

@@ -48,7 +48,7 @@ class FileType extends AbstractType
     public function getDefaultOptions(array $options)
     {
         return array(
-            'type' => 'string',
+            'type' => 'file',
         );
     }
 

+ 2 - 2
tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php

@@ -102,13 +102,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
         if (0 === strpos($pathinfo, '/a')) {
             if (0 === strpos($pathinfo, '/a/b')) {
                 // foo
-                if (0 === strpos($pathinfo, '/a/b') && preg_match('#^/a/b/(?P<foo>[^/]+?)$#x', $pathinfo, $matches)) {
+                if (preg_match('#^/a/b/(?P<foo>[^/]+?)$#x', $pathinfo, $matches)) {
                     $matches['_route'] = 'foo';
                     return $matches;
                 }
         
                 // bar
-                if (0 === strpos($pathinfo, '/a/b') && preg_match('#^/a/b/(?P<bar>[^/]+?)$#x', $pathinfo, $matches)) {
+                if (preg_match('#^/a/b/(?P<bar>[^/]+?)$#x', $pathinfo, $matches)) {
                     $matches['_route'] = 'bar';
                     return $matches;
                 }

+ 2 - 2
tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher2.php

@@ -114,13 +114,13 @@ class ProjectUrlMatcher extends Symfony\Tests\Component\Routing\Fixtures\Redirec
         if (0 === strpos($pathinfo, '/a')) {
             if (0 === strpos($pathinfo, '/a/b')) {
                 // foo
-                if (0 === strpos($pathinfo, '/a/b') && preg_match('#^/a/b/(?P<foo>[^/]+?)$#x', $pathinfo, $matches)) {
+                if (preg_match('#^/a/b/(?P<foo>[^/]+?)$#x', $pathinfo, $matches)) {
                     $matches['_route'] = 'foo';
                     return $matches;
                 }
         
                 // bar
-                if (0 === strpos($pathinfo, '/a/b') && preg_match('#^/a/b/(?P<bar>[^/]+?)$#x', $pathinfo, $matches)) {
+                if (preg_match('#^/a/b/(?P<bar>[^/]+?)$#x', $pathinfo, $matches)) {
                     $matches['_route'] = 'bar';
                     return $matches;
                 }