-
Notifications
You must be signed in to change notification settings - Fork 2
/
IntegrationTest.php
37 lines (31 loc) · 1.12 KB
/
IntegrationTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace Schnittstabil\Psr7\Csrf\Middlewares;
use Schnittstabil\Csrf\Twig\Helpers\Extension as CsrfTwigExtension;
/**
* AcceptHeaderToken tests.
*/
class IntegrationTest extends \Twig_Test_IntegrationTestCase
{
public function getExtensions()
{
$tokens = (new \ArrayObject([
'eyJpYXQiOjE0NTU1NTA1NzUsInR0bCI6MTQ0MCwiZXhwIjoxNDU1NTUyMDE1fQ'
.'.qhqpQ9QNhy9il4MkMYHU9r7X91Td8FtyI3HunMZIG2GPEvPQ0kVgqSbg_nhxgrdbq7QgUY2CO_6GcP4cuXd9FQ',
'<script>console.log("I am nasty!");</script>',
'eyJpYXQiOjE0NTU1NTA1NzUsInR0bCI6MTQ0MCwiZXhwIjoxNDU1NTUyMDE1fQ'
.'.qhqpQ9QNhy9il4MkMYHU9r7X91Td8FtyI3HunMZIG2GPEvPQ0kVgqSbg_nhxgrdbq7QgUY2CO_6GcP4cuXd9FQ',
'<script>console.log("I am nasty!");</script>',
]))->getIterator();
return array(
new CsrfTwigExtension(function () use ($tokens) {
$result = $tokens->current();
$tokens->next();
return $result;
}),
);
}
public function getFixturesDir()
{
return dirname(__FILE__).'/Fixtures/';
}
}