2
2
3
3
declare (strict_types=1 );
4
4
5
- namespace Arkitect \Tests \E2E \ PHPUnit ;
5
+ namespace Arkitect \Tests \Integration ;
6
6
7
- use Arkitect \ClassSet ;
8
7
use Arkitect \Expression \ForClasses \HaveNameMatching ;
9
8
use Arkitect \Expression \ForClasses \IsAbstract ;
10
9
use Arkitect \Expression \ForClasses \IsNotAbstract ;
@@ -25,14 +24,12 @@ public function test_is_abstract_in_that_should_not_consider_final_traits_enums_
25
24
{
26
25
$ runner = TestRunner::create ('8.4 ' );
27
26
28
- $ set = ClassSet::fromDir ($ this ->createClasses ());
29
-
30
27
$ rule = Rule::allClasses ()
31
28
->that (new IsAbstract ())
32
29
->should (new HaveNameMatching ('*Abstract ' ))
33
30
->because ('we want to prefix abstract classes ' );
34
31
35
- $ runner ->run ($ set , $ rule );
32
+ $ runner ->run ($ this -> createClasses () , $ rule );
36
33
37
34
$ this ->assertCount (0 , $ runner ->getViolations ());
38
35
$ this ->assertCount (0 , $ runner ->getParsingErrors ());
@@ -42,14 +39,12 @@ public function test_is_abstract_in_should_should_consider_final_traits_enums_in
42
39
{
43
40
$ runner = TestRunner::create ('8.4 ' );
44
41
45
- $ set = ClassSet::fromDir ($ this ->createClasses ());
46
-
47
42
$ rule = Rule::allClasses ()
48
43
->that (new HaveNameMatching ('My* ' ))
49
44
->should (new IsAbstract ())
50
45
->because ('everything in the app namespace should be abstract ' );
51
46
52
- $ runner ->run ($ set , $ rule );
47
+ $ runner ->run ($ this -> createClasses () , $ rule );
53
48
54
49
$ this ->assertCount (4 , $ runner ->getViolations ());
55
50
$ this ->assertCount (0 , $ runner ->getParsingErrors ());
@@ -64,14 +59,12 @@ public function test_is_not_abstract_in_should_should_consider_final_traits_enum
64
59
{
65
60
$ runner = TestRunner::create ('8.4 ' );
66
61
67
- $ set = ClassSet::fromDir ($ this ->createClasses ());
68
-
69
62
$ rule = Rule::allClasses ()
70
63
->that (new HaveNameMatching ('My* ' ))
71
64
->should (new IsNotAbstract ())
72
65
->because ('everything in the app namespace should be abstract ' );
73
66
74
- $ runner ->run ($ set , $ rule );
67
+ $ runner ->run ($ this -> createClasses () , $ rule );
75
68
76
69
$ this ->assertCount (1 , $ runner ->getViolations ());
77
70
$ this ->assertCount (0 , $ runner ->getParsingErrors ());
@@ -144,12 +137,8 @@ public function __construct(HappyClass $happy)
144
137
],
145
138
];
146
139
147
- $ dir = vfsStream::setup ('root ' , null , $ structure )->url ();
148
-
149
140
$ runner = TestRunner::create ('8.4 ' );
150
141
151
- $ set = ClassSet::fromDir ($ dir );
152
-
153
142
$ rule = Rule::allClasses ()
154
143
->that (new ResideInOneOfTheseNamespaces ('App\BadCode ' ))
155
144
->andThat (new ResideInOneOfTheseNamespaces ('App\HappyIsland ' ))
@@ -161,7 +150,7 @@ public function __construct(HappyClass $happy)
161
150
->andShould (new IsNotTrait ())
162
151
->because ('some reason ' );
163
152
164
- $ runner ->run ($ set , $ rule );
153
+ $ runner ->run (vfsStream:: setup ( ' root ' , null , $ structure )-> url () , $ rule );
165
154
166
155
$ this ->assertCount (0 , $ runner ->getViolations ());
167
156
$ this ->assertCount (0 , $ runner ->getParsingErrors ());
0 commit comments