diff --git a/test/Mustache/Test/Functional/MustacheInheritanceSpecTest.php b/test/Mustache/Test/Functional/MustacheInheritanceSpecTest.php new file mode 100644 index 0000000..9c07d1d --- /dev/null +++ b/test/Mustache/Test/Functional/MustacheInheritanceSpecTest.php @@ -0,0 +1,55 @@ + array(Mustache_Engine::PRAGMA_BLOCKS), + )); + } + + /** + * For some reason data providers can't mark tests skipped, so this test exists + * simply to provide a 'skipped' test if the `spec` submodule isn't initialized. + */ + public function testSpecInitialized() + { + if (!file_exists(dirname(__FILE__) . '/../../../../vendor/spec/specs/')) { + $this->markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); + } + } + + /** + * @group inheritance + * @dataProvider loadInheritanceSpec + */ + public function testInheritanceSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadInheritanceSpec() + { + // return $this->loadSpec('sections'); + // return []; + // die; + return $this->loadSpec('~inheritance'); + } +}