Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added fluent inteface to prepend and set method. Zend\View\Container\AbstractContainer #2671

Closed
wants to merge 2 commits into from

2 participants

starJammer Matthew Weier O'Phinney
starJammer

I ran into an issue doing the following.

$this->headTitle()->prepend( 'stuff' )->setSeparator( ':::' );

The prepend method wasn't returning $this. I added that and also added it to the set method right above it.

Matthew Weier O'Phinney weierophinney was assigned
Deleted user Unknown referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'feature/2671' into develop
Close #2671
b1f04b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. Added fluent inteface to prepend and set method.

    Jerry Saravia authored
  2. Added tests for set and prepend fluency.

    Jerry Saravia authored
This page is out of date. Refresh to see the latest.
2  library/Zend/View/Helper/Placeholder/Container/AbstractContainer.php
View
@@ -98,6 +98,7 @@ public function __construct()
public function set($value)
{
$this->exchangeArray(array($value));
+ return $this;
}
/**
@@ -111,6 +112,7 @@ public function prepend($value)
$values = $this->getArrayCopy();
array_unshift($values, $value);
$this->exchangeArray($values);
+ return $this;
}
/**
20 tests/ZendTest/View/Helper/Placeholder/ContainerTest.php
View
@@ -126,6 +126,26 @@ public function testSetPostfixImplementsFluentInterface()
/**
* @return void
*/
+
+ public function testPrependImplementsFluentInterface()
+ {
+ $result = $this->container->prepend( 'test' );
+ $this->assertSame($this->container, $result);
+ }
+
+ /**
+ * @return void
+ */
+ public function testSetImplementsFluentInterface()
+ {
+ $result = $this->container->set( 'test' );
+ $this->assertSame($this->container, $result);
+ }
+
+
+ /**
+ * @return void
+ */
public function testSeparatorAccesorsWork()
{
$this->assertEquals('', $this->container->getSeparator());
Something went wrong with that request. Please try again.