Swap out spyc for sfYaml.

spyc has a parsing bug which causes partials to fail. I mean, they fail for other reasons too. And we're getting to those. But we don't need to debug YAML parsers while we're at it.
This commit is contained in:
Justin Hileman
2010-11-24 05:07:35 -05:00
parent ab29f6eef4
commit e0ec0d0e18
13 changed files with 2072 additions and 1030 deletions
+4 -6
View File
@@ -1,7 +1,7 @@
<?php
require_once '../Mustache.php';
require_once './lib/spyc.php';
require_once './lib/yaml/lib/sfYamlParser.php';
/**
* A PHPUnit test case wrapping the Mustache Spec
@@ -77,10 +77,6 @@ class MustacheSpecTest extends PHPUnit_Framework_TestCase {
* @dataProvider loadPartialsSpec
*/
public function testPartialsSpec($template, $data, $partials, $expected, $desc) {
// skip partial recursion tests, see: http://hile.mn/bYIIYt
if (strpos($desc, 'recurse') !== false) {
$this->markTestSkipped('Mustache.php has an issue with recursive partials. See http://hile.mn/bYIIYt');
}
$m = new Mustache($template, $data, $partials);
$this->assertEquals($expected, $m->render(), $desc);
}
@@ -138,7 +134,9 @@ class MustacheSpecTest extends PHPUnit_Framework_TestCase {
$data = array();
$spec = spyc_load_file($filename);
$yaml = new sfYamlParser();
$spec = $yaml->parse(file_get_contents($filename));
foreach ($spec['tests'] as $test) {
$data[] = array($test['template'], $test['data'], isset($test['partials']) ? $test['partials'] : array(), $test['expected'], $test['desc']);
}