N°6097 - Tests: Temporarily add test case for the new ItopCustomDatamodelTestCase class

This commit is contained in:
Molkobain
2023-03-13 14:21:17 +01:00
parent fe3467309d
commit b86d70623e
2 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
<classes>
<class id="Person">
<fields>
<field id="tested_attribute" xsi:type="AttributeString" _delta="define">
<sql>tested_attribute</sql>
<default_value/>
<is_null_allowed>true</is_null_allowed>
</field>
</fields>
</class>
</classes>
</itop_design>

View File

@@ -0,0 +1,39 @@
<?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;
/**
* Tests of the DBSearch class.
* <ul>
* <li>MakeGroupByQuery</li>
* </ul>
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
class TestGLATest extends ItopCustomDatamodelTestCase
{
/**
* @inheritDoc
*/
public function GetDatamodelDeltaAbsPath(): string
{
return APPROOT.'tests/php-unit-tests/unitary-tests/core/TestGLATest.delta.xml';
}
public function testFoo()
{
static::assertFalse(MetaModel::IsValidAttCode('Person', 'non_existing_attribute'));
static::assertTrue(MetaModel::IsValidAttCode('Person', 'tested_attribute'));
}
}