Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SourceArgumentsReaderTest.php
Go to the documentation of this file.
1 <?php
7 
8 require_once __DIR__ . '/_files/SourceArgumentsReaderTest.php.sample';
9 
10 class SourceArgumentsReaderTest extends \PHPUnit\Framework\TestCase
11 {
16 
17  protected function setUp()
18  {
19  $this->sourceArgumentsReader = new \Magento\Framework\Code\Reader\SourceArgumentsReader();
20  }
21 
27  public function testGetConstructorArgumentTypes($class, $expectedResult)
28  {
29  $class = new \ReflectionClass($class);
30  $actualResult = $this->sourceArgumentsReader->getConstructorArgumentTypes($class);
31  $this->assertEquals($expectedResult, $actualResult);
32  }
33 
35  {
36  return [
37  [
38  'Some\Testing\Name\Space\AnotherSimpleClass',
39  [
40  '\Some\Testing\Name\Space\Item',
41  '\Imported\Name\Space\One',
42  '\Imported\Name\Space\AnotherTest\Extended',
43  '\Imported\Name\Space\Test',
44  '\Imported\Name\Space\ClassName\Under\Test',
45  '\Imported\Name\Space\ClassName',
46  '\Some\Testing\Name\Space\Test',
47  '\Exception',
48  '',
49  '\Imported\Name\Space\ClassName',
50  'array',
51  ''
52  ],
53  ],
54  [
55  '\stdClass',
56  [null]
57  ]
58  ];
59  }
60 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
$_option $_optionId $class
Definition: date.phtml:13