Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Add Renderer test
Browse files Browse the repository at this point in the history
  • Loading branch information
umpirsky committed Aug 17, 2016
1 parent 41ad4f8 commit 5cebf92
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Tests/Security/TwoFactor/RendererTest.php
@@ -0,0 +1,28 @@
<?php

namespace Scheb\TwoFactorBundle\Tests\Security\TwoFactor;

use Scheb\TwoFactorBundle\Security\TwoFactor\Renderer;
use Scheb\TwoFactorBundle\Tests\TestCase;

class RendererTest extends TestCase
{
/**
* @test
*/
public function render_returnResponse()
{
$response = $this->createMock('Symfony\Component\HttpFoundation\Response');
$templating = $this->createMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
$templating
->expects($this->any())
->method('renderResponse')
->will($this->returnValue($response))
;
$context = $this->createMock('Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface');

$renderer = new Renderer($templating, 'AcmeTestBundle:Test:auth.html.twig');

$this->assertEquals($response, $renderer->render($context));
}
}

0 comments on commit 5cebf92

Please sign in to comment.