mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6097 - Tests: Temporarily add test case for the new ItopCustomDatamodelTestCase class
This commit is contained in:
@@ -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>
|
||||
39
tests/php-unit-tests/unitary-tests/core/TestGLATest.php
Normal file
39
tests/php-unit-tests/unitary-tests/core/TestGLATest.php
Normal 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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user