From 404c16ae4107bde32c0516663564e671b6f1f608 Mon Sep 17 00:00:00 2001 From: AD7six Date: Tue, 11 Nov 2014 08:48:12 +0000 Subject: [PATCH] doc blocks for test functions --- tests/TestCase/View/BakeViewTest.php | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/TestCase/View/BakeViewTest.php b/tests/TestCase/View/BakeViewTest.php index 66500517b19..19b59ae3443 100644 --- a/tests/TestCase/View/BakeViewTest.php +++ b/tests/TestCase/View/BakeViewTest.php @@ -48,6 +48,11 @@ public function tearDown() { unset($this->View); } +/** + * test rendering a string + * + * @return void + */ public function testRenderString() { $template = 'The value of aVariable is: <%= $aVariable %>.'; @@ -58,6 +63,11 @@ public function testRenderString() { $this->assertSame($expected, $result, 'variables in erb-style tags should be evaluated'); } +/** + * test rendering a template file + * + * @return void + */ public function testRenderTemplate() { $this->View->set(['aVariable' => 123]); $result = $this->View->render('view_tests/simple'); @@ -66,6 +76,11 @@ public function testRenderTemplate() { $this->assertSame($expected, $result, 'variables in erb-style tags should be evaluated'); } +/** + * verify that php tags are ignored + * + * @return void + */ public function testRenderIgnorePhpTags() { $template = 'The value of aVariable is: <%= $aVariable %>. Not .'; @@ -76,6 +91,11 @@ public function testRenderIgnorePhpTags() { $this->assertSame($expected, $result, 'variables in php tags should be treated as strings'); } +/** + * verify that short php tags are ignored + * + * @return void + */ public function testRenderIgnorePhpShortTags() { $template = 'The value of aVariable is: <%= $aVariable %>. Not .'; @@ -86,6 +106,11 @@ public function testRenderIgnorePhpShortTags() { $this->assertSame($expected, $result, 'variables in php tags should be treated as strings'); } +/** + * Newlines after template tags should act predictably + * + * @return void + */ public function testRenderNewlines() { $result = $this->View->render('view_tests/newlines'); $expected = "There should be a newline about here: \n"; @@ -100,6 +125,11 @@ public function testRenderNewlines() { ); } +/** + * Verify that template tags with leading whitespace don't leave a mess + * + * @return void + */ public function testSwallowLeadingWhitespace() { $result = $this->View->render('view_tests/leading-whitespace'); $expected = $this->_getCompareTemplate('leading-whitespace');