<?php

namespace Bodyrep\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Response;

class MemberControllerTest extends WebTestCase
{
    private $authcrawler;
    private $authclient;

    function __construct()
    {
      $this->authclient = static::createClient();
      $this->authclient->followRedirects(true);
      $this->authcrawler = $this->authclient->request('GET', '/u/login');


      $form = $this->authcrawler->selectButton('loginbtn')->form();
      $this->authcrawler = $this->authclient->submit($form, array(
          '_username' => 'alexl',
          '_password' => 'd559ko54'
      ));

    }

    public function testIndex()
    {
        $this->assertTrue($this->authcrawler->filter('html:contains("Member landing")')->count() > 0);

    } 

    public function testEditProfile()
    {


        $this->authcrawler = $this->authclient->request('GET', '/m/profile');

        $this->assertTrue($this->authcrawler->filter('html:contains("Edit Profile")')->count() > 0);

    }
    
}
?>
