diff --git a/application/Espo/ORM/Defs/IndexDefs.php b/application/Espo/ORM/Defs/IndexDefs.php index bbb2946571..e8584c4af4 100644 --- a/application/Espo/ORM/Defs/IndexDefs.php +++ b/application/Espo/ORM/Defs/IndexDefs.php @@ -74,7 +74,7 @@ class IndexDefs */ public function isUnique() : bool { - $type = $this->data['tyoe'] ?? null; + $type = $this->data['type'] ?? null; return $type === 'unique'; } diff --git a/tests/unit/Espo/ORM/DefsTest.php b/tests/unit/Espo/ORM/DefsTest.php index d4452dce58..ad2c89a992 100644 --- a/tests/unit/Espo/ORM/DefsTest.php +++ b/tests/unit/Espo/ORM/DefsTest.php @@ -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());