Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ArgumentInterpreterTest.php
Go to the documentation of this file.
1 <?php
7 
8 use \Magento\Framework\App\Arguments\ArgumentInterpreter;
9 
10 class ArgumentInterpreterTest extends \PHPUnit\Framework\TestCase
11 {
15  private $object;
16 
17  protected function setUp()
18  {
19  $const = $this->createPartialMock(\Magento\Framework\Data\Argument\Interpreter\Constant::class, ['evaluate']);
20  $const->expects(
21  $this->once()
22  )->method(
23  'evaluate'
24  )->with(
25  ['value' => 'FIXTURE_INIT_PARAMETER']
26  )->will(
27  $this->returnValue('init_param_value')
28  );
29  $this->object = new ArgumentInterpreter($const);
30  }
31 
32  public function testEvaluate()
33  {
34  $expected = ['argument' => 'init_param_value'];
35  $this->assertEquals($expected, $this->object->evaluate(['value' => 'FIXTURE_INIT_PARAMETER']));
36  }
37 }