mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
fix tests
This commit is contained in:
parent
2473992319
commit
d78dfa7e74
|
|
@ -125,7 +125,7 @@ abstract class ModuleAbstract
|
|||
$this->app = $app ?? new class() extends ApplicationAbstract {};
|
||||
|
||||
if (self::$auditor === null && static::ID !== 1006200000) {
|
||||
self::$auditor = $this->app->moduleManager?->get('Auditor', 'Api');
|
||||
self::$auditor = $this->app->moduleManager->get('Auditor', 'Api');
|
||||
self::$auditor = self::$auditor === null || self::$auditor::ID === 0 ? null : self::$auditor;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,10 @@ class SmartDateTime extends \DateTime
|
|||
$yearChange = (int) \floor(((int) $this->format('m') - 1 + $m) / 12);
|
||||
$yearNew = (int) $this->format('Y') + $y + $yearChange;
|
||||
|
||||
$monthNew = ((int) $this->format('m') + $m - 1) % 12 + 1;
|
||||
$monthNew = (int) $this->format('m') + $m;
|
||||
$monthNew = $monthNew < 0
|
||||
? 12 + ($monthNew - 1) % 12 + 1
|
||||
: ($monthNew - 1) % 12 + 1;
|
||||
|
||||
$dayMonthOld = \cal_days_in_month($calendar, (int) $this->format('m'), (int) $this->format('Y'));
|
||||
$dayMonthNew = \cal_days_in_month($calendar, $monthNew, $yearNew);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ namespace phpOMS\tests\Stdlib\Base;
|
|||
|
||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||
|
||||
require_once __DIR__ . '/../../Autoloader.php';
|
||||
|
||||
/**
|
||||
* @testdox phpOMS\tests\Stdlib\Base\SmartDateTimeTest: DateTime type with additional functionality
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user