コード例 #1
0
ファイル: CalendsTest.php プロジェクト: danhunsaker/calends
 /**
  * @covers ::getCalendar
  */
 public function testGetCalendar()
 {
     TestHelpers::ensureEloquentSampleCalendar();
     // Retrieves the canonical calendar name
     $this->assertEquals('unix', Calends::getCalendar('unix'));
     // Registers Eloquent calendar object
     $this->assertEquals('eloquent', Calends::getCalendar('eloquent'));
     // Throws exception on unfound calendars
     $this->setExpectedException('Danhunsaker\\Calends\\UnknownCalendarException', "Can't find the 'invalid' calendar!");
     Calends::getCalendar('invalid');
 }
コード例 #2
0
ファイル: CalendsSpec.php プロジェクト: danhunsaker/calends
 public function it_should_recognize_extra_broken()
 {
     TestHelpers::ensureEloquentSampleCalendar();
     $this->beConstructedWith('', 'extra-broken');
     $this->shouldHaveType('Danhunsaker\\Calends\\Calends');
     $this->getDate('unix')->shouldBeLike('0');
 }
コード例 #3
0
 /**
  * @Given the eloquent sample calendar
  */
 public function theEloquentSampleCalendar()
 {
     TestHelpers::ensureEloquentSampleCalendar();
 }