/
FormulaLoaderTest.php
44 lines (35 loc) · 1.2 KB
/
FormulaLoaderTest.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
38
39
40
41
42
43
44
<?php
namespace Goetas\TwitalBundle\Tests\Assetic;
use Assetic\Factory\Resource\ResourceInterface;
use Goetas\Twital\TwitalLoader;
use Goetas\TwitalBundle\Assetic\TwitalFormulaLoader;
use Goetas\TwitalBundle\Tests\TestCase;
use Twig\Environment;
class TwigFormulaLoaderTest extends TestCase
{
private $twig;
private $twitalLoader;
protected function setUp()
{
if (!class_exists('Assetic\Extension\Twig\TwigFormulaLoader') || !class_exists(Environment::class)) {
$this->markTestSkipped();
}
$this->twitalLoader = new TwitalLoader();
$this->twig = new Environment($this->twitalLoader);
}
public function testMixture()
{
$twitalLoader = $this->createMock(TwitalLoader::class);
$loader = new TwitalFormulaLoader($twitalLoader, $this->twig);
$resource = $this->createMock(ResourceInterface::class);
/*
$resource->expects($this->once())
->method('__toString')
->will($this->returnValue('aaa.html.twital'));
*/
$resource->expects($this->once())
->method('getContent')
->will($this->returnValue('<div/>'));
$loader->load($resource);
}
}