Skip to content

Commit 5d817b7

Browse files
authored
Merge pull request #321 from Lukasss93/abstracts-modifier
[4.x] Add `abstracts()` modifier to architectural testing documentation
2 parents a1cf94e + bfbccbd commit 5d817b7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch-testing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ Sometimes, you may want to apply the given expectation but excluding certain typ
735735
- [`extending()`](#modifier-extending)
736736
- [`implementing()`](#modifier-implementing)
737737
- [`using()`](#modifier-using)
738+
- [`abstracts()`](#modifier-abstracts)
738739

739740
</div>
740741

@@ -851,6 +852,18 @@ arch('app')
851852
->using(HasFactory::class)
852853
->toExtend(Model::class);
853854
```
855+
856+
<a name="modifier-abstracts"></a>
857+
### `abstracts()`
858+
859+
The `abstracts()` modifier allows you to restrict the expectation to only abstract classes.
860+
861+
```php
862+
arch('app')
863+
->expect('App')
864+
->abstracts()
865+
->toImplement(JsonSerializable::class);
866+
```
854867
---
855868

856869
In this section, you have learned how to perform architectural testing, ensuring that your application or library's architecture meets a specified set of architectural requirements. Next, have you ever wondered how to test the performance of your code? Let's explore [Stress Testing](/docs/stress-testing).

0 commit comments

Comments
 (0)