mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
Merge branch 'support/3.2' into develop
# Conflicts: # core/attributedef.class.inc.php # datamodels/2.x/version.xml # tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php # tests/php-unit-tests/unitary-tests/core/AttributeDefinitionTest.php
This commit is contained in:
@@ -273,12 +273,13 @@ PHP
|
||||
{
|
||||
$oDateAttribute = $this->GivenAttribute(\WorkOrder::class, 'start_date', AttributeDate::class, 'zabugomeuh', false);
|
||||
|
||||
$defaultValue = $oDateAttribute->GetDefaultValue();
|
||||
|
||||
$defaultValue = $oDateAttribute->GetDefaultValue()
|
||||
self::AssertLastErrorLogEntryContains("Invalid default value 'zabugomeuh' for field 'start_date' on class 'WorkOrder', defaulting to null", "Last error log entry should contain a meaningful message");
|
||||
|
||||
self::assertNull($defaultValue, 'Invalid default value for Date attribute should give null default value');
|
||||
}
|
||||
|
||||
|
||||
public function testDateInvalidDefaultReturnsNullAsDefaultValue_Case2()
|
||||
{
|
||||
$oDateAttribute = $this->GivenAttribute(\WorkOrder::class, 'start_date', AttributeDate::class, '"27/01/2025"', false);
|
||||
@@ -292,18 +293,18 @@ PHP
|
||||
public function testDateTimeNowAsDefaultGivesCurrentDateAsDefaultValue()
|
||||
{
|
||||
$oDateAttribute = $this->GivenAttribute(\WorkOrder::class, 'start_date', AttributeDateTime::class, 'NOW()', false);
|
||||
|
||||
$sDefaultValue = $oDateAttribute->GetDefaultValue();
|
||||
|
||||
self::AssertDateTimeEqualsNow($sDefaultValue, 'NOW() should be evaluated as the current date and time');
|
||||
}
|
||||
|
||||
public function testDateNowAsDefaultGivesCurrentDateAsDefaultValue()
|
||||
{
|
||||
$oDateAttribute = $this->GivenAttribute(\WorkOrder::class, 'start_date', AttributeDate::class, 'NOW()', false);
|
||||
|
||||
$sDefaultValue = $oDateAttribute->GetDefaultValue();
|
||||
$defaultValue = $oDateAttribute->GetDefaultValue();
|
||||
|
||||
self::AssertDateEqualsNow($sDefaultValue, 'NOW() should be evaluated as the current date');
|
||||
self::AssertDateEqualsNow($defaultValue, 'NOW() should be evaluated as the current date');
|
||||
}
|
||||
|
||||
public function testDateTimeIntervalAsDefaultGivesCorrectDateAsDefaultValue()
|
||||
|
||||
Reference in New Issue
Block a user