3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-02 14:29:30 +00:00
Files
snipe-it/tests/Support/InteractsWithResponses.php
2023-06-07 16:16:30 -07:00

20 lines
596 B
PHP

<?php
namespace Tests\Support;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Testing\TestResponse;
trait InteractsWithResponses
{
private function assertResponseContainsInRows(TestResponse $response, Model $model, string $field = 'name')
{
$this->assertTrue(collect($response['rows'])->pluck($field)->contains($model->{$field}));
}
private function assertResponseDoesNotContainInRows(TestResponse $response, Model $model, string $field = 'name')
{
$this->assertFalse(collect($response['rows'])->pluck($field)->contains($model->{$field}));
}
}