Last active
October 13, 2015 15:18
-
-
Save isidromerayo/4215490 to your computer and use it in GitHub Desktop.
Symfony2 WebTestCase client status code 200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Hcuv\TiendaBundle\Tests\Controller; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
class DefaultControllerTest extends WebTestCase | |
{ | |
public function testPortadaTienda() | |
{ | |
$client = static::createClient(); | |
$ciudad = 'barcelona'; | |
$tienda = 'pub-consectetur'; | |
$texto = 'Pub Consectetur'; | |
$crawler = $client->request('GET', '/' . $ciudad . '/tiendas/' . $tienda); | |
$messageError = '';// $crawler->filter('div.text_exception h1')->text(); | |
$this->assertEquals(200, $client->getResponse()->getStatusCode(), $messageError); | |
// article | |
$this->assertTrue($crawler->filter('html:contains("' . $texto . '")')->count() > 0); | |
// aside | |
$this->assertTrue($crawler->filter('html:contains("Otras tiendas en")')->count() > 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment