Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TestGeneratorTest.php
Go to the documentation of this file.
1 <?php
8 
9 use AspectMock\Test as AspectMock;
10 
15 
17 {
23  public function testEntityException()
24  {
25  $actionObject = new ActionObject('fakeAction', 'comment', [
26  'userInput' => '{{someEntity.entity}}'
27  ]);
28 
29  $testObject = new TestObject("sampleTest", ["merge123" => $actionObject], [], [], "filename");
30 
31  $testGeneratorObject = TestGenerator::getInstance("", ["sampleTest" => $testObject]);
32 
33  AspectMock::double(TestGenerator::class, ['loadAllTestObjects' => ["sampleTest" => $testObject]]);
34 
35  $this->expectExceptionMessage("Could not resolve entity reference \"{{someEntity.entity}}\" " .
36  "in Action with stepKey \"fakeAction\".\n" .
37  "Exception occurred parsing action at StepKey \"fakeAction\" in Test \"sampleTest\"");
38 
39  $testGeneratorObject->createAllTestFiles(null, []);
40  }
41 }
static getInstance($dir=null, $tests=[], $debug=false)