<?php

namespace Tests\Broilerplate\PublicBundle\Controller;

use Tests\Broilerplate\AbstractTestCase;

class DefaultControllerTest extends AbstractTestCase {

    public function testIndex() {
        $client = $this->createClient();
        $client->request('GET', '/');

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

    public function testNotFound() {
        $client = $this->createClient();
        $client->request('GET', '/not/found');

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

    public function testDatabase() {
        $client = $this->createClient();
        $client->request('GET', '/database');

        $response = $client->getResponse();
        $this->assertTrue($response->isOk());
        $this->assertSame($response->headers->get('Content-Type'), 'application/json');
        $this->assertEquals($response->getContent(), '{"email":"alex.lokhman@gmail.com"}');
    }

}
