This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
espocrm-base/tests/Espo/Utils/ConfiguratorTest.php
T
Taras Machyshyn 417576fd5e change instance
2013-11-01 13:49:54 +02:00

65 lines
1.8 KiB
PHP
Executable File

<?php
namespace Espo\Tests\Utils;
require_once('bootstrap.php');
use Espo\Utils as Utils;
class ConfiguratorTest extends \PHPUnit_Framework_TestCase
{
protected $fixture;
protected function setUp()
{
$this->fixture = new Utils\Configurator();
}
protected function tearDown()
{
$this->fixture = NULL;
}
function testGet()
{
$this->assertStringEndsWith('.php', $this->fixture->get('configPath'));
$this->assertNotNull($this->fixture->get('cachePath'));
$this->assertNotNull($this->fixture->get('layoutConfig'));
$this->assertNotNull($this->fixture->get('metadataConfig'));
$this->assertNotNull($this->fixture->get('languageConfig'));
//permission
$this->assertObjectHasAttribute('dir', $this->fixture->get('defaultPermissions'));
$this->assertObjectHasAttribute('file', $this->fixture->get('defaultPermissions'));
$this->assertObjectHasAttribute('user', $this->fixture->get('defaultPermissions'));
$this->assertObjectHasAttribute('group', $this->fixture->get('defaultPermissions'));
//database
$this->assertObjectHasAttribute('driver', $this->fixture->get('database'));
//logger
$this->assertObjectHasAttribute('dir', $this->fixture->get('logger'));
$this->assertObjectHasAttribute('file', $this->fixture->get('logger'));
$this->assertObjectHasAttribute('level', $this->fixture->get('logger'));
}
function testGetJSON()
{
$this->assertObjectNotHasAttribute('metadataConfig', json_decode($this->fixture->getJSON()));
}
/*function testSet()
{
$setKey= 'testOption';
$setValue= 'Test';
$this->assertTrue($this->fixture->set($setKey, $setValue));
$this->assertEquals($setValue, $this->fixture->get($setKey));
}*/
}
?>