1 | <?php |
||||||
2 | |||||||
3 | namespace Sfneal\Testing\Utils\Traits; |
||||||
4 | |||||||
5 | use Illuminate\Database\Eloquent\Model; |
||||||
6 | |||||||
7 | trait AssertDatabase |
||||||
8 | { |
||||||
9 | /** |
||||||
10 | * Assert that an array of records exists in the database. |
||||||
11 | * |
||||||
12 | * @param Model|string $table |
||||||
13 | * @param array[] $records |
||||||
14 | */ |
||||||
15 | protected function assertDatabaseHasMany($table, array $records) |
||||||
16 | { |
||||||
17 | foreach ($records as $data) { |
||||||
18 | $this->assertDatabaseHas($table, $data); |
||||||
0 ignored issues
–
show
|
|||||||
19 | } |
||||||
20 | } |
||||||
21 | |||||||
22 | /** |
||||||
23 | * Assert that an array of records is missing in the database. |
||||||
24 | * |
||||||
25 | * @param Model|string $table |
||||||
26 | * @param array[] $records |
||||||
27 | */ |
||||||
28 | protected function assertDatabaseMissingMany($table, array $records) |
||||||
29 | { |
||||||
30 | foreach ($records as $data) { |
||||||
31 | $this->assertDatabaseMissing($table, $data); |
||||||
0 ignored issues
–
show
The method
assertDatabaseMissing() does not exist on Sfneal\Testing\Utils\Traits\AssertDatabase . Did you maybe mean assertDatabaseMissingMany() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
32 | } |
||||||
33 | } |
||||||
34 | } |
||||||
35 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.