mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Updated tests with new location.id!=location.parent_id rule
This commit is contained in:
parent
c02adace61
commit
bbc2ac2f9d
|
@ -12,14 +12,30 @@ class LocationTest extends BaseTest
|
||||||
*/
|
*/
|
||||||
protected $tester;
|
protected $tester;
|
||||||
|
|
||||||
// public function testAssetAdd()
|
public function testPassesIfNotSelfParent() {
|
||||||
// {
|
|
||||||
// $location = factory(Location::class)->make();
|
$a = factory(Location::class)->make([
|
||||||
// $values = [
|
'name' => 'Test Location',
|
||||||
// 'name' => $location->name,
|
'id' => 1,
|
||||||
// ];
|
'parent_id' => 10,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertTrue($a->isValid());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testFailsIfSelfParent() {
|
||||||
|
|
||||||
|
$a = factory(Location::class)->make([
|
||||||
|
'name' => 'Test Location',
|
||||||
|
'id' => 1,
|
||||||
|
'parent_id' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertFalse($a->isValid());
|
||||||
|
$this->assertStringContainsString("The parent id and id must be different", $a->getErrors());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Location::create($values);
|
|
||||||
// $this->tester->seeRecord('locations', $values);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue