Coding standard cleanup.
This commit is contained in:
@@ -64,6 +64,7 @@ class ExamplesTest extends \PHPUnit_Framework_TestCase {
|
||||
* Helper method to load an example given the full path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return array arguments for testExamples
|
||||
*/
|
||||
private function loadExample($path) {
|
||||
@@ -106,7 +107,7 @@ class ExamplesTest extends \PHPUnit_Framework_TestCase {
|
||||
/**
|
||||
* Helper method to load partials given an example directory.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $path
|
||||
*
|
||||
* @return array $partials
|
||||
*/
|
||||
|
||||
@@ -40,10 +40,10 @@ class HigherOrderSectionsTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
public function testRuntimeSectionCallback() {
|
||||
$tpl = $this->mustache->loadTemplate('{{#double_wrap}}{{name}}{{/double_wrap}}');
|
||||
$tpl = $this->mustache->loadTemplate('{{#doublewrap}}{{name}}{{/doublewrap}}');
|
||||
|
||||
$foo = new Foo;
|
||||
$foo->double_wrap = array($foo, 'wrapWithBoth');
|
||||
$foo->doublewrap = array($foo, 'wrapWithBoth');
|
||||
|
||||
$this->assertEquals(sprintf('<strong><em>%s</em></strong>', $foo->name), $tpl->render($foo));
|
||||
}
|
||||
@@ -80,10 +80,7 @@ class HigherOrderSectionsTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
sprintf('[[%s]]', $data['name']),
|
||||
$tpl->render($data)
|
||||
);
|
||||
$this->assertEquals(sprintf('[[%s]]', $data['name']), $tpl->render($data));
|
||||
}
|
||||
|
||||
public function testMonsters() {
|
||||
|
||||
@@ -105,7 +105,9 @@ class MustacheInjectionTest extends \PHPUnit_Framework_TestCase {
|
||||
$tpl = $this->mustache->loadTemplate('{{ a }}');
|
||||
|
||||
$data = array(
|
||||
'a' => function() { return '{{ b }}'; },
|
||||
'a' => function() {
|
||||
return '{{ b }}';
|
||||
},
|
||||
'b' => '{{ c }}',
|
||||
'c' => 'FAIL'
|
||||
);
|
||||
@@ -117,7 +119,9 @@ class MustacheInjectionTest extends \PHPUnit_Framework_TestCase {
|
||||
$tpl = $this->mustache->loadTemplate('{{# a }}b{{/ a }}');
|
||||
|
||||
$data = array(
|
||||
'a' => function ($text) { return '{{ ' . $text . ' }}'; },
|
||||
'a' => function ($text) {
|
||||
return '{{ ' . $text . ' }}';
|
||||
},
|
||||
'b' => '{{ c }}',
|
||||
'c' => 'FAIL'
|
||||
);
|
||||
|
||||
@@ -106,11 +106,14 @@ class MustacheSpecTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
$func = $val['php'];
|
||||
$data[$key] = function($text = null) use ($func) { return eval($func); };
|
||||
$data[$key] = function($text = null) use ($func) {
|
||||
return eval($func);
|
||||
};
|
||||
} else if (is_array($val)) {
|
||||
$data[$key] = $this->prepareLambdasSpec($val);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user