You are here

public function BirthdaysBirthdayTestCase::testFromDate in Birthdays 7

Tests conversion directily given values.

File

./birthdays.test, line 81
Unit tests for the Birthdays module.

Class

BirthdaysBirthdayTestCase
Unit tests for the BirthdaysBirthday class.

Code

public function testFromDate() {
  $this
    ->assertIdentical(BirthdaysBirthday::fromDate(0, 0, 0)
    ->isEmpty(), TRUE);
  $this
    ->assertIdentical(BirthdaysBirthday::fromDate(0, 1, 1)
    ->isEmpty(), FALSE);
  try {
    BirthdaysBirthday::fromDate(0, 2, 0);
    $this
      ->fail(t('Exception expected.'));
  } catch (InvalidArgumentException $e) {
    $this
      ->pass($e
      ->getMessage());
  }
}