Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
[zendframework/zendframework#1] s/setLayout/setTemplate/ in plugins
Browse files Browse the repository at this point in the history
- per Akrabat
  • Loading branch information
weierophinney committed Feb 22, 2012
1 parent bfd5623 commit d993918
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Helper/Layout.php
Expand Up @@ -59,7 +59,7 @@ public function getLayout()
* @param string $template
* @return Layout
*/
public function setLayout($template)
public function setTemplate($template)
{
$model = $this->getRoot();
$model->setTemplate((string) $template);
Expand All @@ -80,7 +80,7 @@ public function __invoke($template = null)
if (null === $template) {
return $this->getRoot();
}
return $this->setLayout($template);
return $this->setTemplate($template);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/Helper/LayoutTest.php
Expand Up @@ -59,9 +59,9 @@ public function setUp()
$this->viewModelHelper->setRoot($this->parent);
}

public function testCallingSetLayoutAltersRootModelTemplate()
public function testCallingSetTemplateAltersRootModelTemplate()
{
$this->helper->setLayout('alternate/layout');
$this->helper->setTemplate('alternate/layout');
$this->assertEquals('alternate/layout', $this->parent->getTemplate());
}

Expand All @@ -70,7 +70,7 @@ public function testCallingGetLayoutReturnsRootModelTemplate()
$this->assertEquals('layout', $this->helper->getLayout());
}

public function testCallingInvokeProxiesToSetLayout()
public function testCallingInvokeProxiesToSetTemplate()
{
$helper = $this->helper;
$helper('alternate/layout');
Expand All @@ -91,6 +91,6 @@ public function testRaisesExceptionIfViewModelHelperHasNoRoot()
$helper = $renderer->plugin('layout');

$this->setExpectedException('Zend\View\Exception\RuntimeException', 'view model');
$helper->setLayout('foo/bar');
$helper->setTemplate('foo/bar');
}
}

0 comments on commit d993918

Please sign in to comment.