Skip to content

Commit 654b8b9

Browse files
committed
add laravel assertions to docs
1 parent 0d80dfa commit 654b8b9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,28 @@ This will prevent any method name conflicts with core, your custom or other trai
111111

112112
```php
113113
\Astrotomic\PhpunitAssertions\UuidAssertions::assertUuid('52d08e38-ad24-4960-af02-22e0f7e0db8d');
114+
```
115+
116+
## Laravel Assertions
117+
118+
### Collection
119+
120+
```php
121+
\Astrotomic\PhpunitAssertions\Laravel\CollectionAssertions::assertContains('Astrotomic', collect(['Astrotomic', 'Gummibeer']));
122+
```
123+
124+
### HashID
125+
126+
`composer requuire --dev vinkla/hashids
127+
128+
```php
129+
\Astrotomic\PhpunitAssertions\Laravel\HashidAssertions::assertHashIds('3kTMd', 2);
130+
\Astrotomic\PhpunitAssertions\Laravel\HashidAssertions::assertHashId('yr8');
131+
```
132+
133+
### Model
134+
135+
```php
136+
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertExists($model);
137+
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertSame($model, Model::first());
114138
```

0 commit comments

Comments
 (0)