Skip to content

Commit 03f80b3

Browse files
committed
18 - Teste de arquitetura
1 parent 9f873d0 commit 03f80b3

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

app/Enums/Status.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace App\Enums;
4+
5+
enum Status {
6+
7+
}

app/Interfaces/FileInterface.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace App\Interfaces;
4+
5+
interface FileInterface {
6+
7+
}

phpunit.xml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<testsuite name="Feature">
1212
<directory>tests/Feature</directory>
1313
</testsuite>
14+
<testsuite name="Architecture">
15+
<directory>tests/Architecture</directory>
16+
</testsuite>
1417
</testsuites>
1518
<source>
1619
<include>

tests/Architecture/ArchTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
arch('A pasta app/enums deve aceitar somente emums')
4+
->expect('App\Enums')
5+
->toBeEnums();
6+
7+
arch('A pasta app/interfaces deve aceitar somente interfaces')
8+
->expect('App\Interfaces')
9+
->toBeInterfaces();
10+
11+
arch('Não deve haver uso de dump em produção')
12+
->expect('App')
13+
->not->toUse(['dd', 'dump', 'die']);

0 commit comments

Comments
 (0)