Case sensitive dir stuff

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2021-12-02 14:03:32 -08:00
parent 5555553307
commit 406aed6b07
19 changed files with 0 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace Tests\Unit;
use App\Models\Location;
use Tests\Unit\BaseTest;
class LocationTest extends BaseTest
{
/**
* @var \UnitTester
*/
protected $tester;
public function testPassesIfNotSelfParent()
{
$this->createValidLocation(['id' => 10]);
$a = Location::factory()->make([
'name' => 'Test Location',
'id' => 1,
'parent_id' => 10,
]);
$this->assertTrue($a->isValid());
}
public function testFailsIfSelfParent()
{
$a = Location::factory()->make([
'name' => 'Test Location',
'id' => 1,
'parent_id' => 1,
]);
$this->assertFalse($a->isValid());
$this->assertStringContainsString(trans('validation.non_circular', ['attribute' => 'parent id']), $a->getErrors());
}
}