mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Improve readability
This commit is contained in:
parent
5c0c60a5b9
commit
2eeaef00e1
|
@ -87,33 +87,25 @@ class ReportTemplateTest extends TestCase
|
|||
public function testSelectValuesDoNotIncludeDeletedOrNonExistentModels()
|
||||
{
|
||||
[$locationA, $locationB] = Location::factory()->count(2)->create();
|
||||
$invalidId = 10000;
|
||||
|
||||
$savedReport = ReportTemplate::factory()->create([
|
||||
'options' => [
|
||||
'by_location_id' => [
|
||||
$locationA->id,
|
||||
$locationB->id,
|
||||
10000
|
||||
$invalidId,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$locationB->delete();
|
||||
|
||||
$this->assertContains(
|
||||
$locationA->id,
|
||||
$savedReport->selectValues('by_location_id', Location::class)
|
||||
);
|
||||
$parsedValues = $savedReport->selectValues('by_location_id', Location::class);
|
||||
|
||||
$this->assertNotContains(
|
||||
$locationB->id,
|
||||
$savedReport->selectValues('by_location_id', Location::class)
|
||||
);
|
||||
|
||||
$this->assertNotContains(
|
||||
10000,
|
||||
$savedReport->selectValues('by_location_id', Location::class)
|
||||
);
|
||||
$this->assertContains($locationA->id, $parsedValues);
|
||||
$this->assertNotContains($locationB->id, $parsedValues);
|
||||
$this->assertNotContains($invalidId, $parsedValues);
|
||||
}
|
||||
|
||||
public function testGracefullyHandlesSingleSelectBecomingMultiSelect()
|
||||
|
|
Loading…
Reference in a new issue