mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°8760 - be able to simulate extension removal by oerriding GetExtensionMap be able to simulate SetupAudit errors in Setups for integration tests fix rebase
29 lines
879 B
PHP
29 lines
879 B
PHP
<?php
|
|
|
|
namespace Combodo\iTop\Test\UnitTest\Setup\FeatureRemoval;
|
|
|
|
use Combodo\iTop\Setup\FeatureRemoval\ModelReflectionSerializer;
|
|
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
|
use MetaModel;
|
|
|
|
class ModelSerializationTest extends ItopDataTestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
$this->RequireOnceItopFile('/setup/feature_removal/ModelReflectionSerializer.php');
|
|
}
|
|
|
|
public function testGetModelFromEnvironment()
|
|
{
|
|
$aModel = ModelReflectionSerializer::GetInstance()->GetModelFromEnvironment($this->GetTestEnvironment());
|
|
$this->assertEqualsCanonicalizing(MetaModel::GetClasses(), $aModel);
|
|
}
|
|
|
|
public function testGetModelFromEnvironmentFailure()
|
|
{
|
|
$this->expectException(\CoreException::class);
|
|
$this->expectExceptionMessage("Cannot get classes");
|
|
ModelReflectionSerializer::GetInstance()->GetModelFromEnvironment('gabuzomeu');
|
|
}
|
|
} |