Skip to content

Commit 2daec72

Browse files
committed
order of assertContains feels wrong
1 parent 504c3e0 commit 2daec72

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ This will prevent any method name conflicts with core, your custom or other trai
118118
### Collection
119119

120120
```php
121-
\Astrotomic\PhpunitAssertions\Laravel\CollectionAssertions::assertContains('Astrotomic', collect(['Astrotomic', 'Gummibeer']));
121+
\Astrotomic\PhpunitAssertions\Laravel\CollectionAssertions::assertContains($collection, 'Astrotomic');
122122
```
123123

124124
### HashID
@@ -134,5 +134,5 @@ This will prevent any method name conflicts with core, your custom or other trai
134134

135135
```php
136136
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertExists($model);
137-
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertSame($model, Model::first());
137+
\Astrotomic\PhpunitAssertions\Laravel\ModelAssertions::assertSame($model, User::first());
138138
```

src/Laravel/CollectionAssertions.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
trait CollectionAssertions
99
{
10-
public static function assertContains($expected, $actual): void
10+
public static function assertContains(Enumerable $collection, $expected): void
1111
{
12-
PHPUnit::assertInstanceOf(Enumerable::class, $actual);
13-
PHPUnit::assertTrue($actual->contains($expected));
12+
PHPUnit::assertTrue($collection->contains($expected));
1413
}
1514
}

0 commit comments

Comments
 (0)