File tree Expand file tree Collapse file tree 4 files changed +23
-20
lines changed
lib/internal/Magento/Framework/Code
_files/app/code/Magento/SomeModule/Model/NamedArguments Expand file tree Collapse file tree 4 files changed +23
-20
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Framework \Code \Test \Unit \Validator ;
7
7
8
+ use Magento \SomeModule \Model \NamedArguments \ChildClassTest ;
8
9
use PHPUnit \Framework \TestCase ;
9
10
use Magento \Framework \Code \Validator \ConstructorIntegrity ;
10
- use Magento \SomeModule \Model \One \Test ;
11
11
use Magento \Framework \Exception \ValidatorException ;
12
12
13
13
require_once __DIR__ . '/../_files/app/code/Magento/SomeModule/Model/Three/Test.php ' ;
@@ -32,7 +32,7 @@ protected function setUp(): void
32
32
33
33
public function testValidateIfParentClassExist ()
34
34
{
35
- $ this ->assertTrue ($ this ->_model ->validate (Test::class));
35
+ $ this ->assertTrue ($ this ->_model ->validate (\ Magento \ SomeModule \ Model \ One \ Test::class));
36
36
}
37
37
38
38
public function testValidateIfClassHasParentConstructCall ()
@@ -42,7 +42,7 @@ public function testValidateIfClassHasParentConstructCall()
42
42
43
43
public function testValidateIfClassHasParentConstructCallWithNamedArguments ()
44
44
{
45
- $ this ->assertTrue ($ this ->_model ->validate (\ Magento \ SomeModule \ Model \ NamedArguments \ ChildClassTest::class));
45
+ $ this ->assertTrue ($ this ->_model ->validate (ChildClassTest::class));
46
46
}
47
47
48
48
public function testValidateIfClassHasArgumentsQtyEqualToParentClass ()
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
2
6
declare (strict_types=1 );
7
+
3
8
namespace Magento \SomeModule \Model \NamedArguments ;
4
9
5
10
require_once __DIR__ . '/ParentClassTest.php ' ;
6
11
7
12
class ChildClassTest extends ParentClassTest
8
13
{
9
14
/**
10
- * @var stdClass
11
- */
12
- protected $ stdClassObject ;
13
-
14
- /**
15
- * @var array
16
- */
17
- protected $ arrayVariable ;
18
-
19
- /**
20
- * @param stdClass $stdClassObject
15
+ * @param \stdClass $stdClassObject
21
16
* @param array $arrayVariable
22
17
*/
23
18
public function __construct (\stdClass $ stdClassObject , array $ arrayVariable )
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
2
7
3
8
namespace Magento \SomeModule \Model \NamedArguments ;
4
9
5
10
class ParentClassTest
6
11
{
7
12
/**
8
- * @var stdClass
13
+ * @var \ stdClass
9
14
*/
10
- protected $ stdClassObject ;
15
+ protected \ stdClass $ stdClassObject ;
11
16
12
17
/**
13
18
* @var array
14
19
*/
15
- protected $ arrayVariable ;
20
+ protected array $ arrayVariable ;
16
21
17
22
/**
18
- * @param stdClass $stdClassObject
23
+ * @param \ stdClass $stdClassObject
19
24
* @param array $arrayVariable
20
25
*/
21
26
public function __construct (\stdClass $ stdClassObject , array $ arrayVariable )
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Class constructor validator. Validates call of parent construct
4
- *
5
3
* Copyright © Magento, Inc. All rights reserved.
6
4
* See COPYING.txt for license details.
7
5
*/
6
+ declare (strict_types=1 );
7
+
8
8
namespace Magento \Framework \Code \Validator ;
9
9
10
10
use Magento \Framework \Code \ValidatorInterface ;
11
11
use Magento \Framework \Exception \ValidatorException ;
12
12
use Magento \Framework \Phrase ;
13
13
14
+ /**
15
+ * Class constructor validator. Validates call of parent construct
16
+ */
14
17
class ConstructorIntegrity implements ValidatorInterface
15
18
{
16
19
/**
You can’t perform that action at this time.
0 commit comments