public function testConnect() { $events = new \maniacalendar\Event("WRONG KEY"); $foundError = false; $exception = null; try { $events->getEvents(); } catch (Exception $ex) { $foundError = true; $exception = $ex; } $this->assertTrue($foundError, "Getting right responses. Api key is not defined, and that should give a exception"); $this->assertEquals(403, $exception->getHttpCode()); }
<?php require '../vendor/autoload.php'; $events = new \maniacalendar\Event("apikey"); $result = $events->getEvents(); var_dump($result);