mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-12 02:08:40 +00:00
65 lines
1.9 KiB
PHP
65 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.2
|
|
*
|
|
* @package TBD
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://website.orange-management.de
|
|
*/
|
|
|
|
namespace phpOMS\tests\Utils\TaskSchedule;
|
|
|
|
use phpOMS\Utils\TaskSchedule\TaskAbstract;
|
|
|
|
class TaskAbstractTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private $class = null;
|
|
|
|
protected function setUp()
|
|
{
|
|
$this->class = new class('') extends TaskAbstract {
|
|
public static function createWith(array $jobData) : TaskAbstract
|
|
{
|
|
|
|
}
|
|
};
|
|
}
|
|
|
|
public function testDefault()
|
|
{
|
|
self::assertEquals('', $this->class->getId());
|
|
self::assertEquals('', $this->class->getCommand());
|
|
self::assertEquals('', $this->class->getRun());
|
|
self::assertEquals('', $this->class->getStatus());
|
|
self::assertInstanceOf('\DateTime', $this->class->getNextRunTime());
|
|
self::assertInstanceOf('\DateTime', $this->class->getLastRuntime());
|
|
self::assertEquals('', $this->class->getComment());
|
|
}
|
|
|
|
public function testGetSet()
|
|
{
|
|
$this->class->setCommand('Command');
|
|
self::assertEquals('Command', $this->class->getCommand());
|
|
|
|
$this->class->setRun('Run');
|
|
self::assertEquals('Run', $this->class->getRun());
|
|
|
|
$this->class->setStatus('Status');
|
|
self::assertEquals('Status', $this->class->getStatus());
|
|
|
|
$this->class->setComment('Comment');
|
|
self::assertEquals('Comment', $this->class->getComment());
|
|
|
|
$date = new \DateTime('now');
|
|
$this->class->setLastRuntime($date);
|
|
self::assertEquals($date->format('Y-m-d'), $this->class->getLastRuntime()->format('Y-m-d'));
|
|
|
|
$this->class->setNextRuntime($date);
|
|
self::assertEquals($date->format('Y-m-d'), $this->class->getNextRuntime()->format('Y-m-d'));
|
|
}
|
|
}
|