From 9f8ef8a5757ad39cfa70e783d54be1b0cd7daaa7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 7 Apr 2010 09:16:56 +0200 Subject: [PATCH] fixed tests --- .../Tests/Components/CssSelector/Node/FunctionNodeTest.php | 2 +- .../Tests/Components/DependencyInjection/ContainerTest.php | 2 +- .../Symfony/Tests/Components/RequestHandler/RequestTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Symfony/Tests/Components/CssSelector/Node/FunctionNodeTest.php b/tests/Symfony/Tests/Components/CssSelector/Node/FunctionNodeTest.php index a34924e2d5..e7eef119ec 100644 --- a/tests/Symfony/Tests/Components/CssSelector/Node/FunctionNodeTest.php +++ b/tests/Symfony/Tests/Components/CssSelector/Node/FunctionNodeTest.php @@ -23,7 +23,7 @@ class FunctionNodeTest extends \PHPUnit_Framework_TestCase // h1:contains("foo") $function = new FunctionNode($element, ':', 'contains', 'foo'); - $this->assertEquals("h1[contains(css:lower-case(string(.)), 'foo')]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); + $this->assertEquals("h1[contains(string(.), 'foo')]", (string) $function->toXpath(), '->toXpath() returns the xpath representation of the node'); // h1:nth-child(1) $function = new FunctionNode($element, ':', 'nth-child', 1); diff --git a/tests/Symfony/Tests/Components/DependencyInjection/ContainerTest.php b/tests/Symfony/Tests/Components/DependencyInjection/ContainerTest.php index 13c79e4be7..5d8210c519 100644 --- a/tests/Symfony/Tests/Components/DependencyInjection/ContainerTest.php +++ b/tests/Symfony/Tests/Components/DependencyInjection/ContainerTest.php @@ -170,7 +170,7 @@ class ContainerTest extends \PHPUnit_Framework_TestCase $sc->getFooBar_Foo(); $this->fail('__call() throws a \RuntimeException exception if the method is not a service method'); } - catch (\RuntimeException $e) + catch (\BadMethodCallException $e) { } } diff --git a/tests/Symfony/Tests/Components/RequestHandler/RequestTest.php b/tests/Symfony/Tests/Components/RequestHandler/RequestTest.php index 740bbec5ef..d4893fe4c8 100644 --- a/tests/Symfony/Tests/Components/RequestHandler/RequestTest.php +++ b/tests/Symfony/Tests/Components/RequestHandler/RequestTest.php @@ -39,7 +39,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase $request->setParameters(null, null, array('foo' => 'bar')); $this->assertEquals('bar', $request->getPathParameter('foo'), '->setParameter() takes an array of path parameters as its thrid argument'); - $request->setParameters(null, null, null, array('HTTP_FOO' => 'bar')); + $request->setParameters(null, null, null, null, null, array('HTTP_FOO' => 'bar')); $this->assertEquals('bar', $request->getHttpHeader('foo'), '->setParameter() takes an array of HTTP headers as its fourth argument'); } @@ -48,7 +48,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase */ public function testDuplicate() { - $request = new Request(array('foo' => 'bar'), array('foo' => 'bar'), array('foo' => 'bar'), array('HTTP_FOO' => 'bar')); + $request = new Request(array('foo' => 'bar'), array('foo' => 'bar'), array('foo' => 'bar'), array(), array(), array('HTTP_FOO' => 'bar')); $dup = $request->duplicate(); $this->assertEquals($request->getQueryParameters(), $dup->getQueryParameters(), '->duplicate() duplicates a request an copy the current query parameters'); @@ -56,7 +56,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase $this->assertEquals($request->getPathParameters(), $dup->getPathParameters(), '->duplicate() duplicates a request an copy the current path parameters'); $this->assertEquals($request->getHttpHeader('foo'), $dup->getHttpHeader('foo'), '->duplicate() duplicates a request an copy the current HTTP headers'); - $dup = $request->duplicate(array('foo' => 'foobar'), array('foo' => 'foobar'), array('foo' => 'foobar'), array('HTTP_FOO' => 'foobar')); + $dup = $request->duplicate(array('foo' => 'foobar'), array('foo' => 'foobar'), array('foo' => 'foobar'), array(), array(), array('HTTP_FOO' => 'foobar')); $this->assertEquals(array('foo' => 'foobar'), $dup->getQueryParameters(), '->duplicate() overrides the query parameters if provided'); $this->assertEquals(array('foo' => 'foobar'), $dup->getRequestParameters(), '->duplicate() overrides the request parameters if provided');