Skip to content

Instantly share code, notes, and snippets.

@mmenozzi
Created January 18, 2013 14:22
Show Gist options
  • Save mmenozzi/4564842 to your computer and use it in GitHub Desktop.
Save mmenozzi/4564842 to your computer and use it in GitHub Desktop.
<?php
namespace Charlie\RecruitmentBundle\Tests\Functional;
use Charlie\FixtureBundle\Test\FixtureWebTestCase;
/**
* Created by JetBrains PhpStorm.
* User: ftassi
* Date: 17/01/13
* Time: 15:40
* To change this template use File | Settings | File Templates.
*/
class OneWayControllerTest extends FixtureWebTestCase
{
public function setUp()
{
$this->loadFixtures(
array(
'Charlie\RecruitmentBundle\Tests\Fixtures\OneWayControllerTest\ORM\ApplicationFixture',
)
);
$this->commonSetUp();
}
public function testRecordInterviewAction()
{
$securityCode = 'f07ddfba794336c67d7aa89c6dfd45964c77cd38';
$oneWayParams = array(
'cand_externalid' => 1,
'interview_url' => 'http://foointerviewurl',
'interview_date' => '2012-01-01 08:00',
'security_code' => $securityCode
);
$this->client->request('GET', '/oneway/interview/record', $oneWayParams);
$this->assertTrue($this->client->getResponse()->isSuccessful());
$application = $this->client->getContainer()->get('doctrine')->getEntityManager()
->getRepository('CharlieRecruitmentBundle:Application')
->find(1);
$this->assertEquals('http://foointerviewurl', $application->getInterviewLink());
}
public function testRecordInterviewActionWithInvalidCode()
{
$securityCode = 'fooCode';
$oneWayParams = array(
'cand_externalid' => 1,
'interview_url' => 'http://foointerviewurl',
'interview_date' => '2012-01-01 08:00',
'security_code' => $securityCode
);
$this->client->request('GET', '/oneway/interview/record', $oneWayParams);
$this->assertTrue($this->client->getResponse()->isForbidden());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment