You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
68 lines
2.2 KiB
PHP
68 lines
2.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the PHPFlasher package.
|
|
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
|
*/
|
|
|
|
namespace Flasher\Tests\Prime\Config;
|
|
|
|
use Flasher\Prime\Config\Config;
|
|
use Flasher\Tests\Prime\TestCase;
|
|
|
|
final class ConfigTest extends TestCase
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function testGet()
|
|
{
|
|
/** @phpstan-ignore-next-line */
|
|
$config = new Config(array(
|
|
'default' => 'flasher',
|
|
'root_script' => 'flasher.min.js',
|
|
'themes' => array(
|
|
'flasher' => array(
|
|
'scripts' => array('script.js'),
|
|
'styles' => array('styles.css'),
|
|
'options' => array(),
|
|
),
|
|
),
|
|
'auto_translate' => true,
|
|
'flash_bag' => array(
|
|
'enabled' => true,
|
|
'mapping' => array(
|
|
'success' => array('success'),
|
|
'error' => array('error'),
|
|
),
|
|
),
|
|
'presets' => array(
|
|
'success' => array(
|
|
'type' => 'success',
|
|
'title' => 'Success',
|
|
'message' => 'Success message',
|
|
'options' => array(),
|
|
),
|
|
'error' => array(
|
|
'type' => 'error',
|
|
'title' => 'Error',
|
|
'message' => 'Error message',
|
|
'options' => array(),
|
|
),
|
|
),
|
|
));
|
|
|
|
$this->assertEquals('flasher', $config->get('default'));
|
|
$this->assertEquals(array(
|
|
'scripts' => array('script.js'),
|
|
'styles' => array('styles.css'),
|
|
'options' => array(),
|
|
), $config->get('themes.flasher'));
|
|
$this->assertEquals(array('styles.css'), $config->get('themes.flasher.styles'));
|
|
$this->assertEquals(array('script.js'), $config->get('themes.flasher.scripts'));
|
|
$this->assertEquals(array(), $config->get('themes.flasher.options'));
|
|
$this->assertNull($config->get('drivers.not_exists.options'));
|
|
$this->assertEquals('now_it_exists', $config->get('drivers.not_exists.options', 'now_it_exists'));
|
|
}
|
|
}
|