public function testEvaluate() { $input = array('path' => 'some/path'); $expected = 'http://some.domain.com/some/path/'; $urlParams = array('param'); $this->_interpreter->expects($this->once())->method('evaluate')->with($input)->will($this->returnValue($urlParams)); $this->_urlResolver->expects($this->once())->method('getUrl')->with('some/path', $urlParams)->will($this->returnValue($expected)); $actual = $this->_model->evaluate($input); $this->assertSame($expected, $actual); }
public function testEvaluate() { $input = ['value' => 'some text', 'helper' => __CLASS__ . '::help']; $evaluatedValue = ['value' => 'some text (evaluated)']; $this->_interpreter->expects($this->once())->method('evaluate')->with($input)->will($this->returnValue($evaluatedValue)); $this->_objectManager->expects($this->once())->method('get')->with(__CLASS__)->will($this->returnValue($this)); $expected = 'some text (evaluated) (updated)'; $actual = $this->_model->evaluate($input); $this->assertSame($expected, $actual); }