mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Escape values in response assertion helpers
This commit is contained in:
parent
bd3ba9a5f7
commit
3a5ed031bf
|
@ -24,7 +24,7 @@ trait CustomTestMacros
|
|||
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
||||
$guardAgainstNullProperty($model, $property);
|
||||
|
||||
Assert::assertTrue(collect($this['rows'])->pluck($property)->contains($model->{$property}));
|
||||
Assert::assertTrue(collect($this['rows'])->pluck($property)->contains(e($model->{$property})));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ trait CustomTestMacros
|
|||
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
||||
$guardAgainstNullProperty($model, $property);
|
||||
|
||||
Assert::assertFalse(collect($this['rows'])->pluck($property)->contains($model->{$property}));
|
||||
Assert::assertFalse(collect($this['rows'])->pluck($property)->contains(e($model->{$property})));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ trait CustomTestMacros
|
|||
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
||||
$guardAgainstNullProperty($model, $property);
|
||||
|
||||
Assert::assertTrue(collect($this->json('results'))->pluck('id')->contains($model->{$property}));
|
||||
Assert::assertTrue(collect($this->json('results'))->pluck('id')->contains(e($model->{$property})));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ trait CustomTestMacros
|
|||
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
||||
$guardAgainstNullProperty($model, $property);
|
||||
|
||||
Assert::assertFalse(collect($this->json('results'))->pluck('id')->contains($model->{$property}));
|
||||
Assert::assertFalse(collect($this->json('results'))->pluck('id')->contains(e($model->{$property})));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue