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

Closed
wants to merge 2 commits into
from
@@ -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;
}
/**
@@ -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());