From 03224cc4f6d0240e8ba2ce49a134f015a7bec208 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 28 Jan 2021 15:39:38 +0200 Subject: [PATCH] fixes --- .../Espo/Core/Authentication/Login/ApiKey.php | 1 - .../Core/Utils/Config/ConfigWriterTest.php | 2 +- tests/unit/Espo/Core/Utils/ConfigTest.php | 60 ------------------- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/application/Espo/Core/Authentication/Login/ApiKey.php b/application/Espo/Core/Authentication/Login/ApiKey.php index 02f40ab17f..3dd6ae5125 100644 --- a/application/Espo/Core/Authentication/Login/ApiKey.php +++ b/application/Espo/Core/Authentication/Login/ApiKey.php @@ -33,7 +33,6 @@ use Espo\Core\{ Api\Request, Authentication\LoginData, Authentication\Result, - Api\Request, Authentication\Helpers\UserFinder, }; diff --git a/tests/unit/Espo/Core/Utils/Config/ConfigWriterTest.php b/tests/unit/Espo/Core/Utils/Config/ConfigWriterTest.php index 2b8554d965..178c803a98 100644 --- a/tests/unit/Espo/Core/Utils/Config/ConfigWriterTest.php +++ b/tests/unit/Espo/Core/Utils/Config/ConfigWriterTest.php @@ -60,7 +60,7 @@ class ConfigWriterTest extends \PHPUnit\Framework\TestCase { $this->configWriter->set('k1', 'v1'); - $this->configWriter->setMass([ + $this->configWriter->setMultiple([ 'k2' => 'v2', 'k3' => 'v3', ]); diff --git a/tests/unit/Espo/Core/Utils/ConfigTest.php b/tests/unit/Espo/Core/Utils/ConfigTest.php index 01824e9737..9c51cadbad 100644 --- a/tests/unit/Espo/Core/Utils/ConfigTest.php +++ b/tests/unit/Espo/Core/Utils/ConfigTest.php @@ -96,66 +96,6 @@ class ConfigTest extends \PHPUnit\Framework\TestCase $this->assertTrue($this->config->get('isInstalled')); } - - public function testSet() - { - $setKey= 'testOption'; - $setValue= 'Test'; - - $this->config->set($setKey, $setValue); - $this->assertTrue($this->config->save()); - $this->assertEquals($setValue, $this->config->get($setKey)); - - $this->config->set($setKey, 'Another Wrong Value'); - $this->assertTrue($this->config->save()); - } - - public function testSetNull() - { - $setKey= 'testOption'; - $setValue= 'Test'; - - $this->config->set($setKey, $setValue); - $this->assertTrue($this->config->save()); - $this->assertEquals($setValue, $this->config->get($setKey)); - - $this->config->set($setKey, null); - $this->assertTrue($this->config->save()); - $this->assertNull($this->config->get($setKey)); - } - - public function testSetArray() - { - $values = array( - 'testOption' => 'Test', - 'testOption2' => 'Test2', - ); - - $this->config->set($values); - $this->assertTrue($this->config->save()); - $this->assertEquals('Test', $this->config->get('testOption')); - $this->assertEquals('Test2', $this->config->get('testOption2')); - - $wrongArray = array( - 'testOption' => 'Another Wrong Value', - ); - $this->config->set($wrongArray); - $this->assertTrue($this->config->save()); - } - - public function testRemove() - { - $optKey = 'removeOption'; - $optValue = 'Test'; - - $this->config->set($optKey, $optValue); - $this->assertTrue($this->config->save()); - - $this->assertTrue($this->config->remove($optKey)); - - $this->assertNull($this->config->get($optKey)); - } - public function testSystemConfigMerge() { $configDataWithoutSystem = $this->fileManager->getPhpContents($this->configPath);