ArgumentInterpreterTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\Test\Unit\Arguments;
  7. use \Magento\Framework\App\Arguments\ArgumentInterpreter;
  8. class ArgumentInterpreterTest extends \PHPUnit\Framework\TestCase
  9. {
  10. /**
  11. * @var \Magento\Framework\App\Arguments\ArgumentInterpreter
  12. */
  13. private $object;
  14. protected function setUp()
  15. {
  16. $const = $this->createPartialMock(\Magento\Framework\Data\Argument\Interpreter\Constant::class, ['evaluate']);
  17. $const->expects(
  18. $this->once()
  19. )->method(
  20. 'evaluate'
  21. )->with(
  22. ['value' => 'FIXTURE_INIT_PARAMETER']
  23. )->will(
  24. $this->returnValue('init_param_value')
  25. );
  26. $this->object = new ArgumentInterpreter($const);
  27. }
  28. public function testEvaluate()
  29. {
  30. $expected = ['argument' => 'init_param_value'];
  31. $this->assertEquals($expected, $this->object->evaluate(['value' => 'FIXTURE_INIT_PARAMETER']));
  32. }
  33. }