Commit Graph

7 Commits

Author SHA1 Message Date
Fabien Potencier
da23747a1a [HttpKernel] removed Response assertions
They are too magic and they don't really add value:

    $this->assertResponseStatusCodeEmpty($client);
    $this->assertTrue($client->getResponse()->isEmpty());

    $this->assertResponseStatusCodeNotFound($client);
    $this->assertTrue($client->getResponse()->isNotFound());

    $this->assertResponseStatusCodeForbidden($client);
    $this->assertTrue($client->getResponse()->isForbidden());

    $this->assertResponseStatusCodeOk($client);
    $this->assertTrue($client->getResponse()->isOk());

    $this->assertResponseStatusCodeServerError($client);
    $this->assertTrue($client->getResponse()->isServerError());

    $this->assertResponseStatusCodeClientError($client);
    $this->assertTrue($client->getResponse()->isClientError());

    $this->assertResponseStatusCodeRedirection($client);
    $this->assertTrue($client->getResponse()->isRedirection());

    $this->assertResponseStatusCodeSuccessful($client);
    $this->assertTrue($client->getResponse()->isSuccessful());

    $this->assertResponseStatusCodeInformational($client);
    $this->assertTrue($client->getResponse()->isInformational());

    $this->assertResponseStatusCode(200, $client);
    $this->assertEquals(200, $client->getResponse()->getStatusCode());

    $this->assertResponseStatusCodeRedirect('google.com', $client);
    $this->assertTrue($client->getResponse()->isRedirected('google.com'));

    $this->assertResponseNotRegExp('/foo/', $client);
    $this->assertNotRegExp('/foo', $client->getResponse()->getContent());

    $this->assertResponseRegExp('/foo/', $client);
    $this->assertRegExp('/foo', $client->getResponse()->getContent());

    $this->assertResponseNotSelectExists('h1', $client);
    $this->assertTrue($crawler->filter('h1')->isEmpty());

    $this->assertResponseSelectExists('h1', $client);
    $this->assertFalse($crawler->filter('h1')->isEmpty());

    $this->assertResponseSelectCount(3, 'h1', $client);
    $this->assertEquals(3, $crawler->filter('h1')->count());

    $this->assertResponseSelectEquals($expected, $selector, $arguments, $client);
    $this->assertEquals($expected, $crawler->filter($selector)->extract($arguments));

    $this->assertResponseHeaderEquals($value, $key, $client);
    $this->assertTrue($client->getResponse()->headers->contains($key, $value));

    $this->assertResponseNotHeaderEquals($value, $key, $client);
    $this->assertFalse($client->getResponse()->headers->contains($key, $value));

    $this->assertResponseHeaderRegExp($regex, $key, $client);
    $this->assertRegExp($regex, $client->getResponse()->headers->get($key));

    $this->assertResponseNotHeaderRegExp($regex, $key, $client);
    $this->assertNotRegExp($regex, $client->getResponse()->headers->get($key));

    $this->assertResponseCookie($value, $attributes, $name, $client);
    $this->assertTrue($client->getResponse()->hasCookie($name));
2010-06-23 10:39:33 +02:00
Fabien Potencier
7661e9a5f7 [HttpKernel] changed the semantic of Response::__toString() to something more useful 2010-06-23 10:34:53 +02:00
Fabien Potencier
005051c389 [HttpKernel] added support for weak etags and added a method to set all cookies 2010-05-19 11:24:31 +02:00
Jordi Boggiano
9ed3d0468e folded all curly brackets of control structures to conform to PEAR/ZF CS, part two 2010-05-09 09:15:22 +02:00
Jordi Boggiano
2684de0d8e Folded all curly brackets of control structures to conform to PEAR/ZF CS 2010-05-07 18:24:05 +02:00
Fabien Potencier
83c6d337e2 changed coding standards: indendation is now 4 spaces 2010-05-06 13:25:53 +02:00
Fabien Potencier
6328d514a3 renamed RequestHandler component to HttpKernel 2010-05-06 12:04:50 +02:00