Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConstantTest.php
Go to the documentation of this file.
1 <?php
7 
8 use \Magento\Framework\Data\Argument\Interpreter\Constant;
9 
10 class ConstantTest extends \PHPUnit\Framework\TestCase
11 {
15  private $object;
16 
17  protected function setUp()
18  {
19  $this->object = new Constant();
20  }
21 
22  public function testEvaluate()
23  {
24  // it is defined in framework/bootstrap.php
25  $this->assertEquals(TESTS_TEMP_DIR, $this->object->evaluate(['value' => 'TESTS_TEMP_DIR']));
26  }
27 
33  public function testEvaluateBadValue($value)
34  {
35  $this->object->evaluate($value);
36  }
37 
41  public function evaluateBadValueDataProvider()
42  {
43  return [
44  [['value' => 'KNOWINGLY_UNDEFINED_CONSTANT']],
45  [['value' => '']],
46  [[]]
47  ];
48  }
49 }
$value
Definition: gender.phtml:16