Skip to content
Snippets Groups Projects
Select Git revision
  • 88cafd1b75eee37cdc5b324ad13b8d844ff801bb
  • master default protected
  • devel
  • feature/add-escaping-to-templates
  • feature/add-priority-sorting
  • 3.3.0
  • 3.2.1
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.4.12
  • 2.4.11
  • 2.4.10
  • 2.4.9
  • 2.4.8
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.2
  • 2.3.1
  • 2.3
25 results

.env.testing

Blame
  • TestDirResolver.php 823 B
    <?php
    
    
    use WPDesk\View\Resolver\Exception\CanNotResolve;
    
    class TestDirResolver extends \PHPUnit\Framework\TestCase
    {
        const TEMPLATE_NAME = 'some_template.php';
        const TEMPLATE_FILE = 'some_template.php';
        const TEMPLATE_SUBDIR = 'templates';
    
    
        public function testCanFindInDirPath()
        {
            $dir = __DIR__ . '/' . self::TEMPLATE_SUBDIR;
            $resolver           = new \WPDesk\View\Resolver\DirResolver($dir);
    
            $this->assertStringEndsWith(self::TEMPLATE_FILE, $resolver->resolve(self::TEMPLATE_NAME),
                'Template should be found in dir');
        }
    
        public function testThrowExceptionWhenCannotFind()
        {
            $this->expectException(CanNotResolve::class);
    
            $resolver = new \WPDesk\View\Resolver\DirResolver('whatever');
            $resolver->resolve('whatever2');
        }
    }