/** * @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'); }
public function it_should_recognize_extra_broken() { TestHelpers::ensureEloquentSampleCalendar(); $this->beConstructedWith('', 'extra-broken'); $this->shouldHaveType('Danhunsaker\\Calends\\Calends'); $this->getDate('unix')->shouldBeLike('0'); }
/** * @Given the eloquent sample calendar */ public function theEloquentSampleCalendar() { TestHelpers::ensureEloquentSampleCalendar(); }