mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-28 06:02:59 -08:00
20 lines
596 B
PHP
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}));
|
||
|
}
|
||
|
}
|