ltsecurityinc安防产品在线商城代码
This commit is contained in:
+60
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Framework\Code\Reader;
|
||||
|
||||
require_once __DIR__ . '/_files/SourceArgumentsReaderTest.php.sample';
|
||||
|
||||
class SourceArgumentsReaderTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var \Magento\Framework\Code\Reader\SourceArgumentsReader
|
||||
*/
|
||||
protected $sourceArgumentsReader;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->sourceArgumentsReader = new \Magento\Framework\Code\Reader\SourceArgumentsReader();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param array $expectedResult
|
||||
* @dataProvider getConstructorArgumentTypesDataProvider
|
||||
*/
|
||||
public function testGetConstructorArgumentTypes($class, $expectedResult)
|
||||
{
|
||||
$class = new \ReflectionClass($class);
|
||||
$actualResult = $this->sourceArgumentsReader->getConstructorArgumentTypes($class);
|
||||
$this->assertEquals($expectedResult, $actualResult);
|
||||
}
|
||||
|
||||
public function getConstructorArgumentTypesDataProvider()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'Some\Testing\Name\Space\AnotherSimpleClass',
|
||||
[
|
||||
'\Some\Testing\Name\Space\Item',
|
||||
'\Imported\Name\Space\One',
|
||||
'\Imported\Name\Space\AnotherTest\Extended',
|
||||
'\Imported\Name\Space\Test',
|
||||
'\Imported\Name\Space\ClassName\Under\Test',
|
||||
'\Imported\Name\Space\ClassName',
|
||||
'\Some\Testing\Name\Space\Test',
|
||||
'\Exception',
|
||||
'',
|
||||
'\Imported\Name\Space\ClassName',
|
||||
'array',
|
||||
''
|
||||
],
|
||||
],
|
||||
[
|
||||
'\stdClass',
|
||||
[null]
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Some\Testing\Name\Space;
|
||||
|
||||
use Imported\Name\Space\One as FirstImport;
|
||||
use Imported\Name\Space\ClassName;
|
||||
use Imported\Name\Space\Test as Testing, \Imported\Name\Space\AnotherTest ;
|
||||
|
||||
class AnotherSimpleClass
|
||||
{
|
||||
public function __construct(
|
||||
\Some\Testing\Name\Space\Item $itemOne,
|
||||
FirstImport $itemTwo,
|
||||
AnotherTest\Extended $itemThree,
|
||||
Testing $itemFour,
|
||||
ClassName\Under\Test $itemFive,
|
||||
ClassName $itemSix,
|
||||
Test $itemSeven,
|
||||
?\Exception $optionalException,
|
||||
$defaultString = '$default),value;',
|
||||
?ClassName $optionalWithDefaultValue = null,
|
||||
array $itemEight = [],
|
||||
$itemNine = 'test'
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user