mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 21:27:44 +03:00
Created CustomizableAppConfigTest
This commit is contained in:
parent
0d9c7282df
commit
0525639329
1 changed files with 40 additions and 0 deletions
40
module/Installer/test/CustomizableAppConfigTest.php
Normal file
40
module/Installer/test/CustomizableAppConfigTest.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\Installer;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Shlinkio\Shlink\Installer\Config\Plugin\ApplicationConfigCustomizer;
|
||||
use Shlinkio\Shlink\Installer\Config\Plugin\LanguageConfigCustomizer;
|
||||
use Shlinkio\Shlink\Installer\Model\CustomizableAppConfig;
|
||||
|
||||
class CustomizableAppConfigTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function exchangeArrayIgnoresAnyNonProvidedKey()
|
||||
{
|
||||
$config = new CustomizableAppConfig();
|
||||
|
||||
$config->exchangeArray([
|
||||
'app_options' => [
|
||||
'disable_track_param' => null,
|
||||
],
|
||||
'translator' => [
|
||||
'locale' => 'es',
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertFalse($config->hasDatabase());
|
||||
$this->assertFalse($config->hasUrlShortener());
|
||||
$this->assertTrue($config->hasApp());
|
||||
$this->assertTrue($config->hasLanguage());
|
||||
$this->assertEquals([
|
||||
ApplicationConfigCustomizer::DISABLE_TRACK_PARAM => null,
|
||||
], $config->getApp());
|
||||
$this->assertEquals([
|
||||
LanguageConfigCustomizer::DEFAULT_LANG => 'es',
|
||||
], $config->getLanguage());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue