tests/Flow/Directives/UseTest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Tests\Flow\Directives;

use Tests\Unit;

class UseTest extends Unit
{

    public function testUse()
    {
        $hello = 'PHP: Hello World';

        $code = <<<code
        {% use \Bavix\Helpers\Str %}
        {{ Str::sub(message, 0, 3) }}
code;

        $this->assertSame(
            $this->eval($code, [
                'message' => $hello
            ]),
            'PHP'
        );
    }

}