Completed
Push — 2.x ( dc834d...91b37b )
by
unknown
02:07
created

MustacheTest::testMustache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 2
Metric Value
c 3
b 1
f 2
dl 0
loc 19
rs 9.4285
cc 1
eloc 14
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\EasyExtendsBundle\Tests\Generator;
13
14
use Sonata\EasyExtendsBundle\Generator\Mustache;
15
16
class MustacheTest extends \PHPUnit_Framework_TestCase
17
{
18
    public function testMustache()
19
    {
20
        $this->assertEquals(Mustache::replace(' Hello {{ world }}', array(
21
          'world' => 'world',
22
        )), ' Hello world');
23
24
        $this->assertEquals(Mustache::replace(' Hello {{world}}', array(
25
          'world' => 'world',
26
        )), ' Hello world');
27
28
        $this->assertEquals(Mustache::replace(' Hello {{ world }}', array(
29
          'no-world' => 'world',
30
        )), ' Hello {{ world }}');
31
32
        $file = sprintf('%s/../fixtures/test.mustache', __DIR__);
33
        $this->assertEquals(Mustache::replaceFromFile($file, array(
34
          'world' => 'world',
35
        )), 'Hello world');
36
    }
37
}
38