-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchTest.php
More file actions
65 lines (54 loc) · 1.83 KB
/
ArchTest.php
File metadata and controls
65 lines (54 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
arch('Domain layer does not depend on Application layer')
->expect('ComplexHeart\Domain')
->not->toUse('ComplexHeart\Application');
arch('Application layer can depend on Domain layer')
->expect('ComplexHeart\Application')
->toUse('ComplexHeart\Domain');
arch('Domain Model interfaces are correctly placed')
->expect('ComplexHeart\Domain\Contracts\Model')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Domain\Contracts\Model',
'ComplexHeart\Domain\Contracts\Events',
'ComplexHeart\Application',
]);
arch('Domain Event interfaces are correctly placed')
->expect('ComplexHeart\Domain\Contracts\Events')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Domain',
'ComplexHeart\Application',
]);
arch('Application Command interfaces are correctly placed')
->expect('ComplexHeart\Application\Command')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Application',
]);
arch('Application Query interfaces are correctly placed')
->expect('ComplexHeart\Application\Query')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Application',
]);
arch('Application Handler interfaces are correctly placed')
->expect('ComplexHeart\Application\Handler')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Application',
]);
arch('Application Messaging interfaces are correctly placed')
->expect('ComplexHeart\Application\Messaging')
->toBeInterfaces()
->toOnlyBeUsedIn([
'ComplexHeart\Application',
'ComplexHeart\Domain\Contracts\Model', // Aggregate uses EventBus
]);
arch('all interfaces are suffixed correctly')
->expect('ComplexHeart')
->classes()
->toBeInterfaces();
arch()->preset()->php();
arch()->preset()->security();