N°6097 - Tests: Enable PHP unit tests on a custom DataModel

This commit is contained in:
Molkobain
2023-03-13 10:34:32 +01:00
parent b86d70623e
commit f002aa04cd
10 changed files with 500 additions and 12 deletions

View File

@@ -0,0 +1,34 @@
<?php
/*
* @copyright Copyright (C) 2010-2023 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopCustomDatamodelTestCase;
use DBObjectSet;
use DBSearch;
use MetaModel;
/**
* @runTestsInSeparateProcesseszzz
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
class TestGLA2Test extends ItopCustomDatamodelTestCase
{
/**
* @inheritDoc
*/
public function GetDatamodelDeltaAbsPath(): string
{
return APPROOT.'tests/php-unit-tests/unitary-tests/core/TestGLA/TestGLA2Test.delta.xml';
}
public function testFoo()
{
static::assertFalse(MetaModel::IsValidAttCode('Person', 'non_existing_attribute2'));
static::assertTrue(MetaModel::IsValidAttCode('Person', 'tested_attribute2'));
}
}