Skip to content

Instantly share code, notes, and snippets.

@gpfiel
Created January 30, 2014 11:38
Show Gist options
  • Save gpfiel/8706816 to your computer and use it in GitHub Desktop.
Save gpfiel/8706816 to your computer and use it in GitHub Desktop.
How cna i know if it is inside the form posting?
<?php
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
use \CodeGuy;
class UC001LoginTest extends AbstractHttpControllerTestCase
{
protected function setUp()
{
$this->setApplicationConfig(
include 'C:/wamp/www/extranet/config/application.config.php'
);
parent::setUp();
}
protected function tearDown()
{
}
public function testAcaoLogin()
{
$this->dispatch('/login');
$this->assertResponseStatusCode(200);
$this->assertModuleName('Application');
$this->assertControllerName('Application\Controller\Login');
$this->assertControllerClass('LoginController');
$this->assertMatchedRouteName('login');
$dadosLogin = array("email" => "[email protected]", "senha" => "123456");
$this->dispatch('/login', 'POST', $dadosLogin);
$this->assertResponseStatusCode(200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment