diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index 35390c1..7178786 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -244,7 +244,8 @@ class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase } } -class MustacheStub extends Mustache_Engine { +class MustacheStub extends Mustache_Engine +{ public $source; public $template; public function loadTemplate($source) diff --git a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php index 9862d06..f010f3c 100644 --- a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php +++ b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php @@ -13,15 +13,17 @@ * @group lambdas * @group functional */ -class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit_Framework_TestCase { - +class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit_Framework_TestCase +{ private $mustache; - public function setUp() { + public function setUp() + { $this->mustache = new Mustache_Engine; } - public function testAnonymousFunctionSectionCallback() { + public function testAnonymousFunctionSectionCallback() + { $tpl = $this->mustache->loadTemplate('{{#wrapper}}{{name}}{{/wrapper}}'); $foo = new Mustache_Test_FiveThree_Functional_Foo; @@ -33,7 +35,8 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit $this->assertEquals(sprintf('
%s
', $foo->name), $tpl->render($foo)); } - public function testSectionCallback() { + public function testSectionCallback() + { $one = $this->mustache->loadTemplate('{{name}}'); $two = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); @@ -44,7 +47,8 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit $this->assertEquals(sprintf('%s', $foo->name), $two->render($foo)); } - public function testViewArrayAnonymousSectionCallback() { + public function testViewArrayAnonymousSectionCallback() + { $tpl = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); $data = array( @@ -58,12 +62,14 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit } } -class Mustache_Test_FiveThree_Functional_Foo { +class Mustache_Test_FiveThree_Functional_Foo +{ public $name = 'Justin'; public $lorem = 'Lorem ipsum dolor sit amet,'; public $wrap; - public function __construct() { + public function __construct() + { $this->wrap = function($text) { return sprintf('%s', $text); }; diff --git a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php index 86b8795..2414850 100644 --- a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php +++ b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php @@ -15,11 +15,12 @@ * @group mustache-spec * @group functional */ -class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framework_TestCase { - +class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framework_TestCase +{ private static $mustache; - public static function setUpBeforeClass() { + public static function setUpBeforeClass() + { self::$mustache = new Mustache_Engine; } @@ -27,7 +28,8 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew * 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() { + public function testSpecInitialized() + { if (!file_exists(dirname(__FILE__).'/../../../../../vendor/spec/specs/')) { $this->markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); } @@ -37,19 +39,22 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew * @group lambdas * @dataProvider loadLambdasSpec */ - public function testLambdasSpec($desc, $source, $partials, $data, $expected) { + public function testLambdasSpec($desc, $source, $partials, $data, $expected) + { $template = self::loadTemplate($source, $partials); $this->assertEquals($expected, $template($this->prepareLambdasSpec($data)), $desc); } - public function loadLambdasSpec() { + public function loadLambdasSpec() + { return $this->loadSpec('~lambdas'); } /** * Extract and lambdafy any 'lambda' values found in the $data array. */ - private function prepareLambdasSpec($data) { + private function prepareLambdasSpec($data) + { foreach ($data as $key => $val) { if ($key === 'lambda') { if (!isset($val['php'])) { @@ -76,7 +81,8 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew * @access public * @return array */ - private function loadSpec($name) { + private function loadSpec($name) + { $filename = dirname(__FILE__) . '/../../../../../vendor/spec/specs/' . $name . '.yml'; if (!file_exists($filename)) { return array(); @@ -106,7 +112,8 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew return $data; } - private static function loadTemplate($source, $partials) { + private static function loadTemplate($source, $partials) + { self::$mustache->setPartials($partials); return self::$mustache->loadTemplate($source); diff --git a/test/Mustache/Test/Functional/ExamplesTest.php b/test/Mustache/Test/Functional/ExamplesTest.php index 6c335e8..4dd2dae 100644 --- a/test/Mustache/Test/Functional/ExamplesTest.php +++ b/test/Mustache/Test/Functional/ExamplesTest.php @@ -116,7 +116,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase * * @param string $path * - * @return array $partials + * @return array $partials */ private function loadPartials($path) { diff --git a/test/Mustache/Test/Functional/MustacheInjectionTest.php b/test/Mustache/Test/Functional/MustacheInjectionTest.php index c6d6337..7621af8 100644 --- a/test/Mustache/Test/Functional/MustacheInjectionTest.php +++ b/test/Mustache/Test/Functional/MustacheInjectionTest.php @@ -49,7 +49,6 @@ class Mustache_Test_Functional_MustacheInjectionTest extends PHPUnit_Framework_T $this->assertEquals('{{ b }}', $tpl->render($data)); } - // sections public function testSectionInjection() @@ -78,7 +77,6 @@ class Mustache_Test_Functional_MustacheInjectionTest extends PHPUnit_Framework_T $this->assertEquals('{{ c }}', $tpl->render($data)); } - // partials public function testPartialInjection() @@ -111,7 +109,6 @@ class Mustache_Test_Functional_MustacheInjectionTest extends PHPUnit_Framework_T $this->assertEquals('{{ b }}', $tpl->render($data)); } - // lambdas public function testLambdaInterpolationInjection() diff --git a/test/fixtures/examples/partials/Partials.php b/test/fixtures/examples/partials/Partials.php index cfa110c..157bb3a 100644 --- a/test/fixtures/examples/partials/Partials.php +++ b/test/fixtures/examples/partials/Partials.php @@ -1,6 +1,7 @@ 'Page Title', 'subtitle' => 'Page Subtitle',