Created
August 6, 2015 19:00
-
-
Save gilsondev/fa8d2aa01b4e2edf88ac to your computer and use it in GitHub Desktop.
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 PROCERGS\LoginCidadao\CoreBundle\Tests\Controller; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
use Symfony\Component\HttpFoundation\Response; | |
class ProfileControllerTest extends WebTestCase | |
{ | |
/** | |
* @var \Doctrine\ORM\EntityManager | |
*/ | |
protected $em; | |
protected $dummyuser; | |
protected $client; | |
public function setUp() | |
{ | |
$kernel = static::createKernel(); | |
$kernel->boot(); | |
$this->em = $kernel->getContainer()->get('doctrine.orm.entity_manager'); | |
$this->em->beginTransaction(); | |
$this->client = static::createClient(); | |
$usermanager = $kernel->getContainer()->get('fos_user.user_manager'); | |
$this->dummyuser = $usermanager->createUser(); | |
$this->dummyuser->setUsername("test"); | |
$this->dummyuser->setEmail("[email protected]"); | |
$this->dummyuser->setPlainPassword("test123"); | |
$usermanager->updateUser($this->dummyuser); | |
$this->em->close(); | |
} | |
/** | |
* Access profile without user | |
*/ | |
public function testAccessProfileWithoutAccount() | |
{ | |
$crawler = $this->client->request('GET', '/profile/edit'); | |
$this->assertEquals(Response::HTTP_FOUND, $this->client->getResponse()->getStatusCode()); | |
$this->assertRegExp('/\/login$/', $this->client->getResponse()->headers->get('location')); | |
} | |
/** | |
* Editando o perfil do usuario de teste | |
*/ | |
public function testEditProfile() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment