Skip to content

Commit 404c16a

Browse files
committed
doc blocks for test functions
1 parent 3feeed3 commit 404c16a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/TestCase/View/BakeViewTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public function tearDown() {
4848
unset($this->View);
4949
}
5050

51+
/**
52+
* test rendering a string
53+
*
54+
* @return void
55+
*/
5156
public function testRenderString() {
5257
$template = 'The value of aVariable is: <%= $aVariable %>.';
5358

@@ -58,6 +63,11 @@ public function testRenderString() {
5863
$this->assertSame($expected, $result, 'variables in erb-style tags should be evaluated');
5964
}
6065

66+
/**
67+
* test rendering a template file
68+
*
69+
* @return void
70+
*/
6171
public function testRenderTemplate() {
6272
$this->View->set(['aVariable' => 123]);
6373
$result = $this->View->render('view_tests/simple');
@@ -66,6 +76,11 @@ public function testRenderTemplate() {
6676
$this->assertSame($expected, $result, 'variables in erb-style tags should be evaluated');
6777
}
6878

79+
/**
80+
* verify that php tags are ignored
81+
*
82+
* @return void
83+
*/
6984
public function testRenderIgnorePhpTags() {
7085
$template = 'The value of aVariable is: <%= $aVariable %>. Not <?php echo $aVariable ?>.';
7186

@@ -76,6 +91,11 @@ public function testRenderIgnorePhpTags() {
7691
$this->assertSame($expected, $result, 'variables in php tags should be treated as strings');
7792
}
7893

94+
/**
95+
* verify that short php tags are ignored
96+
*
97+
* @return void
98+
*/
7999
public function testRenderIgnorePhpShortTags() {
80100
$template = 'The value of aVariable is: <%= $aVariable %>. Not <?= $aVariable ?>.';
81101

@@ -86,6 +106,11 @@ public function testRenderIgnorePhpShortTags() {
86106
$this->assertSame($expected, $result, 'variables in php tags should be treated as strings');
87107
}
88108

109+
/**
110+
* Newlines after template tags should act predictably
111+
*
112+
* @return void
113+
*/
89114
public function testRenderNewlines() {
90115
$result = $this->View->render('view_tests/newlines');
91116
$expected = "There should be a newline about here: \n";
@@ -100,6 +125,11 @@ public function testRenderNewlines() {
100125
);
101126
}
102127

128+
/**
129+
* Verify that template tags with leading whitespace don't leave a mess
130+
*
131+
* @return void
132+
*/
103133
public function testSwallowLeadingWhitespace() {
104134
$result = $this->View->render('view_tests/leading-whitespace');
105135
$expected = $this->_getCompareTemplate('leading-whitespace');

0 commit comments

Comments
 (0)