|
|
@@ -1106,7 +1106,8 @@ class ViewTest extends TestCase
|
|
|
$View = new View();
|
|
|
|
|
|
$View->helpers = ['Html' => ['foo' => 'bar'], 'Form' => ['foo' => 'baz']];
|
|
|
- $View->loadHelpers();
|
|
|
+ $result = $View->loadHelpers();
|
|
|
+ $this->assertSame($View, $result);
|
|
|
|
|
|
$this->assertInstanceOf('Cake\View\Helper\HtmlHelper', $View->Html, 'Object type is wrong.');
|
|
|
$this->assertInstanceOf('Cake\View\Helper\FormHelper', $View->Form, 'Object type is wrong.');
|
|
|
@@ -1443,9 +1444,12 @@ class ViewTest extends TestCase
|
|
|
*/
|
|
|
public function testBlockCaptureOverwrite()
|
|
|
{
|
|
|
- $this->View->start('test');
|
|
|
+ $result = $this->View->start('test');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
echo 'Block content';
|
|
|
- $this->View->end();
|
|
|
+ $result = $this->View->end();
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
|
|
|
$this->View->start('test');
|
|
|
echo 'New content';
|
|
|
@@ -1501,7 +1505,9 @@ class ViewTest extends TestCase
|
|
|
echo 'Content ';
|
|
|
$this->View->end();
|
|
|
|
|
|
- $this->View->append('test');
|
|
|
+ $result = $this->View->append('test');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
echo 'appended';
|
|
|
$this->View->end();
|
|
|
|
|
|
@@ -1516,7 +1522,9 @@ class ViewTest extends TestCase
|
|
|
*/
|
|
|
public function testBlockSet()
|
|
|
{
|
|
|
- $this->View->assign('test', 'Block content');
|
|
|
+ $result = $this->View->assign('test', 'Block content');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$result = $this->View->fetch('test');
|
|
|
$this->assertEquals('Block content', $result);
|
|
|
}
|
|
|
@@ -1544,7 +1552,9 @@ class ViewTest extends TestCase
|
|
|
$result = $this->View->fetch('test', 'This should not be returned');
|
|
|
$this->assertSame('Block content', $result);
|
|
|
|
|
|
- $this->View->reset('test');
|
|
|
+ $result = $this->View->reset('test');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$result = $this->View->fetch('test', 'This should not be returned');
|
|
|
$this->assertSame('', $result);
|
|
|
}
|
|
|
@@ -1669,7 +1679,8 @@ class ViewTest extends TestCase
|
|
|
public function testBlockPrepend($value)
|
|
|
{
|
|
|
$this->View->assign('test', 'Block');
|
|
|
- $this->View->prepend('test', $value);
|
|
|
+ $result = $this->View->prepend('test', $value);
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
|
|
|
$result = $this->View->fetch('test');
|
|
|
$this->assertEquals($value . 'Block', $result);
|
|
|
@@ -1698,7 +1709,9 @@ class ViewTest extends TestCase
|
|
|
*/
|
|
|
public function testBlockAppendUndefined()
|
|
|
{
|
|
|
- $this->View->append('test', 'Unknown');
|
|
|
+ $result = $this->View->append('test', 'Unknown');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$result = $this->View->fetch('test');
|
|
|
$this->assertEquals('Unknown', $result);
|
|
|
}
|
|
|
@@ -2004,7 +2017,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testGetSetTemplatePath()
|
|
|
{
|
|
|
- $this->View->setTemplatePath('foo');
|
|
|
+ $result = $this->View->setTemplatePath('foo');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$templatePath = $this->View->getTemplatePath();
|
|
|
$this->assertSame($templatePath, 'foo');
|
|
|
}
|
|
|
@@ -2016,7 +2031,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testGetSetLayoutPath()
|
|
|
{
|
|
|
- $this->View->setLayoutPath('foo');
|
|
|
+ $result = $this->View->setLayoutPath('foo');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$layoutPath = $this->View->getLayoutPath();
|
|
|
$this->assertSame($layoutPath, 'foo');
|
|
|
}
|
|
|
@@ -2028,7 +2045,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testAutoLayout()
|
|
|
{
|
|
|
- $this->View->enableAutoLayout(false);
|
|
|
+ $result = $this->View->enableAutoLayout(false);
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$autoLayout = $this->View->isAutoLayoutEnabled();
|
|
|
$this->assertSame($autoLayout, false);
|
|
|
|
|
|
@@ -2044,7 +2063,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testGetSetTheme()
|
|
|
{
|
|
|
- $this->View->setTheme('foo');
|
|
|
+ $result = $this->View->setTheme('foo');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$theme = $this->View->getTheme();
|
|
|
$this->assertSame($theme, 'foo');
|
|
|
}
|
|
|
@@ -2056,7 +2077,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testGetSetTemplate()
|
|
|
{
|
|
|
- $this->View->setTemplate('foo');
|
|
|
+ $result = $this->View->setTemplate('foo');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$template = $this->View->getTemplate();
|
|
|
$this->assertSame($template, 'foo');
|
|
|
}
|
|
|
@@ -2068,7 +2091,9 @@ TEXT;
|
|
|
*/
|
|
|
public function testGetSetLayout()
|
|
|
{
|
|
|
- $this->View->setLayout('foo');
|
|
|
+ $result = $this->View->setLayout('foo');
|
|
|
+ $this->assertSame($this->View, $result);
|
|
|
+
|
|
|
$layout = $this->View->getLayout();
|
|
|
$this->assertSame($layout, 'foo');
|
|
|
}
|