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 55 */
66namespace Magento \Framework \Code \Test \Unit \Validator ;
77
8+ use Magento \SomeModule \Model \NamedArguments \ChildClassTest ;
89use PHPUnit \Framework \TestCase ;
910use Magento \Framework \Code \Validator \ConstructorIntegrity ;
10- use Magento \SomeModule \Model \One \Test ;
1111use Magento \Framework \Exception \ValidatorException ;
1212
1313require_once __DIR__ . '/../_files/app/code/Magento/SomeModule/Model/Three/Test.php ' ;
@@ -32,7 +32,7 @@ protected function setUp(): void
3232
3333 public function testValidateIfParentClassExist ()
3434 {
35- $ this ->assertTrue ($ this ->_model ->validate (Test::class));
35+ $ this ->assertTrue ($ this ->_model ->validate (\ Magento \ SomeModule \ Model \ One \ Test::class));
3636 }
3737
3838 public function testValidateIfClassHasParentConstructCall ()
@@ -42,7 +42,7 @@ public function testValidateIfClassHasParentConstructCall()
4242
4343 public function testValidateIfClassHasParentConstructCallWithNamedArguments ()
4444 {
45- $ this ->assertTrue ($ this ->_model ->validate (\ Magento \ SomeModule \ Model \ NamedArguments \ ChildClassTest::class));
45+ $ this ->assertTrue ($ this ->_model ->validate (ChildClassTest::class));
4646 }
4747
4848 public function testValidateIfClassHasArgumentsQtyEqualToParentClass ()
Original file line number Diff line number Diff line change 11<?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
26declare (strict_types=1 );
7+
38namespace Magento \SomeModule \Model \NamedArguments ;
49
510require_once __DIR__ . '/ParentClassTest.php ' ;
611
712class ChildClassTest extends ParentClassTest
813{
914 /**
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
2116 * @param array $arrayVariable
2217 */
2318 public function __construct (\stdClass $ stdClassObject , array $ arrayVariable )
Original file line number Diff line number Diff line change 11<?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
27
38namespace Magento \SomeModule \Model \NamedArguments ;
49
510class ParentClassTest
611{
712 /**
8- * @var stdClass
13+ * @var \ stdClass
914 */
10- protected $ stdClassObject ;
15+ protected \ stdClass $ stdClassObject ;
1116
1217 /**
1318 * @var array
1419 */
15- protected $ arrayVariable ;
20+ protected array $ arrayVariable ;
1621
1722 /**
18- * @param stdClass $stdClassObject
23+ * @param \ stdClass $stdClassObject
1924 * @param array $arrayVariable
2025 */
2126 public function __construct (\stdClass $ stdClassObject , array $ arrayVariable )
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Class constructor validator. Validates call of parent construct
4- *
53 * Copyright © Magento, Inc. All rights reserved.
64 * See COPYING.txt for license details.
75 */
6+ declare (strict_types=1 );
7+
88namespace Magento \Framework \Code \Validator ;
99
1010use Magento \Framework \Code \ValidatorInterface ;
1111use Magento \Framework \Exception \ValidatorException ;
1212use Magento \Framework \Phrase ;
1313
14+ /**
15+ * Class constructor validator. Validates call of parent construct
16+ */
1417class ConstructorIntegrity implements ValidatorInterface
1518{
1619 /**
You can’t perform that action at this time.
0 commit comments