assertTrue(is_array($context)); } function testFunctionsPHP() { $context = Timber::context(); $this->assertEquals('StarterSite', get_class($context['site'])); $this->assertTrue(current_theme_supports('post-thumbnails')); $this->assertEquals('bar', $context['foo']); } function testLoading() { $str = Timber::compile('tease.twig'); $this->assertStringStartsWith('
', $str); $this->assertStringEndsWith('
', $str); } /** * Helper test to output current twig version */ function testTwigVersion() { $str = Timber::compile_string("{{ constant('Twig_Environment::VERSION') }}"); //error_log('Twig version = '.$str); } function testTwigFilter() { $str = Timber::compile_string('{{ "foo" | myfoo }}'); $this->assertEquals('foo bar!', $str); } static function _setupStarterTheme(){ $dest = WP_CONTENT_DIR . '/themes/' . basename( dirname( dirname( __FILE__ ) ) ); $src = realpath( __DIR__ . '/../../' . basename( dirname( dirname( __FILE__ ) ) ) ); if ( is_dir($src) && !file_exists($dest) ) { symlink($src, $dest); } } }