Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BackslashTrimTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Setup\Module\Di\Compiler\Config\Chain\BackslashTrim;
10 
11 class BackslashTrimTest extends \PHPUnit\Framework\TestCase
12 {
14  {
15  $inputConfig = [
16  'data' => []
17  ];
18  $modifier = new BackslashTrim();
19  $this->assertSame($inputConfig, $modifier->modify($inputConfig));
20  }
21 
22  public function testModifyArguments()
23  {
24  $modifier = new BackslashTrim();
25  $this->assertEquals($this->getOutputConfig(), $modifier->modify($this->getInputConfig()));
26  }
27 
33  private function getInputConfig()
34  {
35  return [
36  'arguments' => [
37  '\\Class' => [
38  'argument_type' => ['_i_' => '\\Class\\Dependency'],
39  'argument_not_shared' => ['_ins_' => '\\Class\\Dependency'],
40  'array' => [
41  'argument_type' => ['_i_' => '\\Class\\Dependency'],
42  'argument_not_shared' => ['_ins_' => '\\Class\\Dependency'],
43  'array' => [
44  'argument_type' => ['_i_' => '\\Class\\Dependency'],
45  'argument_not_shared' => ['_ins_' => '\\Class\\Dependency'],
46  ]
47  ]
48  ]
49  ]
50  ];
51  }
52 
58  private function getOutputConfig()
59  {
60  return [
61  'arguments' => [
62  'Class' => [
63  'argument_type' => ['_i_' => 'Class\\Dependency'],
64  'argument_not_shared' => ['_ins_' => 'Class\\Dependency'],
65  'array' => [
66  'argument_type' => ['_i_' => 'Class\\Dependency'],
67  'argument_not_shared' => ['_ins_' => 'Class\\Dependency'],
68  'array' => [
69  'argument_type' => ['_i_' => 'Class\\Dependency'],
70  'argument_not_shared' => ['_ins_' => 'Class\\Dependency'],
71  ]
72  ]
73  ]
74  ]
75  ];
76  }
77 }