/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['calendr'] = $this->app->share(function ($app) {
         $provider = $app['config']->get('calendr::provider');
         $manager = $app['config']->get('calendr::manager');
         $cal = new Calendar();
         if (class_exists($manager)) {
             $cal->setEventManager(new $manager());
         }
         if (class_exists($provider)) {
             $cal->getEventManager()->addProvider('calendrprovider', new $provider());
         }
         return $cal;
     });
 }
Пример #2
0
 public function testGetEventManager()
 {
     $calendar = new Calendar();
     $this->assertInstanceOf('CalendR\\Event\\Manager', $calendar->getEventManager());
 }