Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FactoryGeneratorTest.php
Go to the documentation of this file.
1 <?php
8 
10 
11 class FactoryGeneratorTest extends \PHPUnit\Framework\TestCase
12 {
16  private $subject;
17 
18  protected function setUp()
19  {
20  $this->subject = new FactoryGenerator();
21  }
22 
23  public function testGenerateFactory()
24  {
25  $this->assertStringMatchesFormat(
26  '%Anamespace My%Aclass SimpleFactory%Afunction create%A',
27  $this->subject->generate('\My\SimpleFactory')
28  );
29  }
30 
36  {
37  $this->assertFalse($this->subject->generate($className));
38  }
39 
44  {
45  return [
46  'non-factory class' => ['\My\SimpleClass'],
47  'non-conventional factory name' => ['\My\Factory'],
48  ];
49  }
50 }
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31