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/MetadataTest.php
T
Taras Machyshyn 417576fd5e change instance
2013-11-01 13:49:54 +02:00

50 lines
1.2 KiB
PHP
Executable File

<?php
namespace Espo\Tests\Utils;
require_once('bootstrap.php');
use Espo\Utils as Utils;
class MetadataTest extends \PHPUnit_Framework_TestCase
{
protected $fixture;
protected function setUp()
{
$this->fixture = new Utils\Metadata();
}
protected function tearDown()
{
$this->fixture = NULL;
}
function testGetFileList()
{
$this->assertTrue(Utils\JSON::isJSON($this->fixture->getMetadata(true, true)));
$this->assertTrue(is_array($this->fixture->getMetadata(false, true)));
}
function testGetConfig()
{
$this->assertObjectHasAttribute('name', $this->fixture->getConfig());
$this->assertObjectHasAttribute('cachePath', $this->fixture->getConfig());
$this->assertObjectHasAttribute('corePath', $this->fixture->getConfig());
}
function testGetEntityPath()
{
$this->assertEquals('Espo\Entities\User', $this->fixture->getEntityPath('User', '\\'));
$this->assertEquals('Espo.Entities.User', $this->fixture->getEntityPath('User', '.'));
$this->assertEquals('Modules\Crm\Entities\Account', $this->fixture->getEntityPath('Account', '\\'));
$this->assertEquals('Modules.Crm.Entities.Account', $this->fixture->getEntityPath('Account', '.'));
}
}
?>