fix index defs

This commit is contained in:
Yuri Kuznetsov
2021-03-09 17:25:50 +02:00
parent 5536687d90
commit 2dfd43c8ba
2 changed files with 3 additions and 3 deletions

View File

@@ -74,7 +74,7 @@ class IndexDefs
*/
public function isUnique() : bool
{
$type = $this->data['tyoe'] ?? null;
$type = $this->data['type'] ?? null;
return $type === 'unique';
}

View File

@@ -228,7 +228,7 @@ class DefsTest extends \PHPUnit\Framework\TestCase
$this->defs->getEntity('Test')->getRelation('r1');
}
public function getIndex1()
public function testGetIndex1()
{
$data = [
'Test' => [
@@ -251,7 +251,7 @@ class DefsTest extends \PHPUnit\Framework\TestCase
$entityDefs = $this->defs->getEntity('Test');
$this->assertEquals(['i1', 'i2'], $entityDefs->getIndexList());
$this->assertEquals(['i1', 'i2'], $entityDefs->getIndexNameList());
$this->assertEquals('i1', $entityDefs->getIndex('i1')->getName());