fixed tests

This commit is contained in:
Fabien Potencier 2010-04-07 09:16:56 +02:00
parent f2d75ed279
commit 9f8ef8a575
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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)
{
}
}

View File

@ -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');