File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22
3- namespace TestTagOnConstructor ;
3+ namespace TestTagOnClass ;
44
55use DaveLiddament \PhpLanguageExtensions \TestTag ;
66
@@ -11,9 +11,16 @@ public function __construct()
1111 {
1212 }
1313
14- public static function create (): Person // No Error , class can interact with itself
14+ public static function create (): Person // OK , class can interact with itself
1515 {
16- return new Person (); // No Error, class can interact with itself
16+ return new Person (); // OK, class can interact with itself
17+ }
18+
19+ public function aMethod (int $ number ): void
20+ {
21+ if ($ number > 0 ) {
22+ $ this ->aMethod ($ number - 1 ); // OK, class can interact with itself
23+ }
1724 }
1825}
1926
@@ -28,4 +35,9 @@ public function buildPerson(): Person
2835 {
2936 return Person::create (); // ERROR
3037 }
38+
39+ public function aMethod (Person $ person ): void
40+ {
41+ $ person ->aMethod (1 ); // ERROR
42+ }
3143}
Original file line number Diff line number Diff line change 11<?php
22
3- namespace TestTagOnConstructor ;
3+ namespace TestTagOnClassIgnoredInTestClass ;
44
55use DaveLiddament \PhpLanguageExtensions \TestTag ;
66
@@ -11,21 +11,30 @@ public function __construct()
1111 {
1212 }
1313
14- public static function create (): Person // No Error, class can interact with itself
14+ public static function create (): Person // OK, class can interact with itself
15+ {
16+ return new Person (); // OK, class can interact with itself
17+ }
18+
19+ public function aMethod (): void
1520 {
16- return new Person (); // No Error, class can interact with itself
1721 }
1822}
1923
2024class PersonTest
2125{
2226 public function newInstance (): Person
2327 {
24- return new Person (); // No Error
28+ return new Person (); // OK, call from test class
2529 }
2630
2731 public function buildPerson (): Person
2832 {
29- return Person::create (); // No error
33+ return Person::create (); // OK, call from test class
34+ }
35+
36+ public function aMethod (Person $ person ): void
37+ {
38+ $ this ->aMethod (); // OK, call from test class
3039 }
3140}
You can’t perform that action at this time.
0 commit comments