mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Merge pull request #13434 from marcusmoore/chore/improve-test-stability
Improved test stability and messaging
This commit is contained in:
commit
a599f0c923
|
@ -24,7 +24,10 @@ trait CustomTestMacros
|
||||||
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
||||||
$guardAgainstNullProperty($model, $property);
|
$guardAgainstNullProperty($model, $property);
|
||||||
|
|
||||||
Assert::assertTrue(collect($this['rows'])->pluck($property)->contains($model->{$property}));
|
Assert::assertTrue(
|
||||||
|
collect($this['rows'])->pluck($property)->contains(e($model->{$property})),
|
||||||
|
"Response did not contain the expected value: {$model->{$property}}"
|
||||||
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +38,10 @@ trait CustomTestMacros
|
||||||
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
function (Model $model, string $property = 'name') use ($guardAgainstNullProperty) {
|
||||||
$guardAgainstNullProperty($model, $property);
|
$guardAgainstNullProperty($model, $property);
|
||||||
|
|
||||||
Assert::assertFalse(collect($this['rows'])->pluck($property)->contains($model->{$property}));
|
Assert::assertFalse(
|
||||||
|
collect($this['rows'])->pluck($property)->contains(e($model->{$property})),
|
||||||
|
"Response contained unexpected value: {$model->{$property}}"
|
||||||
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +52,10 @@ trait CustomTestMacros
|
||||||
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
||||||
$guardAgainstNullProperty($model, $property);
|
$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})),
|
||||||
|
"Response did not contain the expected value: {$model->{$property}}"
|
||||||
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +66,10 @@ trait CustomTestMacros
|
||||||
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
function (Model $model, string $property = 'id') use ($guardAgainstNullProperty) {
|
||||||
$guardAgainstNullProperty($model, $property);
|
$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})),
|
||||||
|
"Response contained unexpected value: {$model->{$property}}"
|
||||||
|
);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue