<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

/**
 * Generated by PHPUnit_SkeletonGenerator on 2019-02-27 at 15:07:59.
 */
class DateTimeObjTest extends \PHPUnit\Framework\TestCase
{
  /**
   * Sets up the fixture, for example, opens a network connection.
   * This method is called before a test is executed.
   */
  protected function setUp(): void
  {
  }

  /**
   * @covers DateTimeObj::compare
   * @test
   */
  public function compare_defaultDate()
  {
    $a = DateTimeObj::createFromString('30.12.1899');
    $b = DateTimeObj::createFromString('30.12.1899 00:00');

    $this->assertEquals(0, $a->compare($b));
    $this->assertEquals(0, $b->compare($a));

    $c = DateTimeObj::createFromString('01.01.2000');
    $this->assertEquals(-1, $a->compare($c));
    $this->assertEquals(1, $c->compare($a));

    $d = DateTimeObj::createFromString('01.01.2000 12:01');
    $this->assertEquals(-1, $a->compare($d));
    $this->assertEquals(1, $d->compare($a));

    $e = DateTimeObj::createFromString('01.01.2040 12:01');
    $this->assertEquals(-1, $a->compare($e));
    $this->assertEquals(1, $e->compare($a));
  }
}
