Skip to content

Commit

Permalink
[HttpKernel] fixed order of arguments for assertions - to be coherent…
Browse files Browse the repository at this point in the history
… with the order of PHPUnit assertions
  • Loading branch information
fabpot committed Jun 21, 2010
1 parent 7db3ef7 commit 8ea13f9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Symfony/Components/HttpKernel/Test/WebTestCase.php
Expand Up @@ -42,24 +42,24 @@ abstract public function createClient(array $options = array(), array $server =
/**
* Asserts that the response matches a given CSS selector.
*
* @param array $expected The expected values for the attributes
* @param string $selector A CSS selector
* @param array $arguments An array of attributes to extract
* @param array $expected The expected values for the attributes
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseSelectEquals($selector, $arguments, $expected, Client $client = null)
public function assertResponseSelectEquals($expected, $selector, $arguments, Client $client = null)
{
$this->assertEquals($expected, $this->getCrawler($client)->filter($selector)->extract($arguments));
}

/**
* Asserts that the response matches a given CSS selector n times.
*
* @param string $selector A CSS selector
* @param integer $count The number of times the CSS selector must match
* @param string $selector A CSS selector
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseSelectCount($selector, $count, Client $client = null)
public function assertResponseSelectCount($count, $selector, Client $client = null)
{
$this->assertEquals($count, $this->getCrawler($client)->filter($selector)->count(), sprintf('response selector "%s" matches "%s" times', $selector, $count));
}
Expand Down Expand Up @@ -89,11 +89,11 @@ public function assertResponseNotSelectExists($selector, Client $client = null)
/**
* Asserts the a response header has the given value.
*
* @param string $key The header name
* @param string $value The header value
* @param string $key The header name
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseHeaderEquals($key, $value, Client $client = null)
public function assertResponseHeaderEquals($value, $key, Client $client = null)
{
$headers = explode(', ', $this->getResponse($client)->headers->get($key));
foreach ($headers as $header) {
Expand All @@ -108,11 +108,11 @@ public function assertResponseHeaderEquals($key, $value, Client $client = null)
/**
* Asserts the a response header has not the given value.
*
* @param string $key The header name
* @param string $value The header value
* @param string $key The header name
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseNotHeaderEquals($key, $value, Client $client = null)
public function assertResponseNotHeaderEquals($value, $key, Client $client = null)
{
$headers = explode(', ', $this->getResponse($client)->headers->get($key));
foreach ($headers as $header) {
Expand All @@ -127,11 +127,11 @@ public function assertResponseNotHeaderEquals($key, $value, Client $client = nul
/**
* Asserts the response header matches the given regexp.
*
* @param string $key The header name
* @param string $regex A regexp
* @param string $key The header name
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseHeaderRegExp($key, $regex, Client $client = null)
public function assertResponseHeaderRegExp($regex, $key, Client $client = null)
{
$headers = explode(', ', $this->getResponse($client)->headers->get($key));
foreach ($headers as $header) {
Expand All @@ -146,11 +146,11 @@ public function assertResponseHeaderRegExp($key, $regex, Client $client = null)
/**
* Asserts the response header does not match the given regexp.
*
* @param string $key The header name
* @param string $regex A regexp
* @param string $key The header name
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseNotHeaderRegExp($key, $regex, Client $client = null)
public function assertResponseNotHeaderRegExp($regex, $key, Client $client = null)
{
$headers = explode(', ', $this->getResponse($client)->headers->get($key));
foreach ($headers as $header) {
Expand All @@ -165,12 +165,12 @@ public function assertResponseNotHeaderRegExp($key, $regex, Client $client = nul
/**
* Asserts if a cookie was set with the given value and attributes.
*
* @param string $name The cookie name
* @param string $value The cookie value
* @param array $attributes Other cookie attributes to check (expires, path, domain, etc)
* @param string $name The cookie name
* @param Symfony\Foundation\Client $client A Client instance
*/
public function assertResponseCookie($name, $value = null, $attributes = array(), Client $client = null)
public function assertResponseCookie($value, $attributes = array(), $name, Client $client = null)
{
foreach ($this->getResponse($client)->getCookies() as $cookie) {
if ($name == $cookie['name']) {
Expand Down

0 comments on commit 8ea13f9

Please sign in to comment.