/** * @test */ public function assignMultipleCanOverridePreviouslyAssignedValues() { $this->templateVariableContainer->expects($this->at(0))->method('add')->with('foo', 'FooValue'); $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValueOverridden'); $this->templateVariableContainer->expects($this->at(2))->method('add')->with('bar', 'BarValue'); $this->view->assign('foo', 'FooValue'); $this->view->assignMultiple(['foo' => 'FooValueOverridden', 'bar' => 'BarValue']); }
/** * @test */ public function assignMultipleCanOverridePreviouslyAssignedValues() { $this->templateVariableContainer->expects($this->at(0))->method('exists')->with('foo')->will($this->returnValue(FALSE)); $this->templateVariableContainer->expects($this->at(1))->method('add')->with('foo', 'FooValue'); $this->templateVariableContainer->expects($this->at(2))->method('exists')->with('foo')->will($this->returnValue(TRUE)); $this->templateVariableContainer->expects($this->at(3))->method('remove')->with('foo'); $this->templateVariableContainer->expects($this->at(4))->method('add')->with('foo', 'FooValueOverridden'); $this->templateVariableContainer->expects($this->at(5))->method('exists')->with('bar')->will($this->returnValue(FALSE)); $this->templateVariableContainer->expects($this->at(6))->method('add')->with('bar', 'BarValue'); $this->view->assign('foo', 'FooValue'); $this->view->assignMultiple(array('foo' => 'FooValueOverridden', 'bar' => 'BarValue')); }