From 3a65e8adf37637c953f7c56b0d37fcae2e2dd238 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 7 Dec 2021 16:19:05 -0500 Subject: [PATCH] Run spec inheritance tests. --- .../MustacheInheritanceSpecTest.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/Mustache/Test/Functional/MustacheInheritanceSpecTest.php 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'); + } +}