From 2dfd43c8ba380ef42081d320372a2112cc9cfc55 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 9 Mar 2021 17:25:50 +0200 Subject: [PATCH] fix index defs --- application/Espo/ORM/Defs/IndexDefs.php | 2 +- tests/unit/Espo/ORM/DefsTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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());