/** * @expectedException \Exception */ public function testInvalid() { $configDirectories = array(FIXTURES_PATH); $locator = new FileLocator($configDirectories); $JsonLoader = new JsonLoader($locator); $JsonLoader->load($locator->locate('invalid.json')); }
public function __construct() { $locator = new FileLocator(array(__DIR__ . '/ServiceDescription')); $jsonLoader = new JsonLoader($locator); $description = $jsonLoader->load($locator->locate('services.json')); $headers = ['X-Mashape-Key' => 'dwOm8WpRxamshUJeTSKCuZJ9lWLkp1JPxzijsnejSHNGN7sz25', 'Accept' => 'text/plain']; $httpClient = new Client(['defaults' => ['headers' => $headers]]); $this->client = new GuzzleClient($httpClient, new Description($description)); }
/** * * DAV Client implementation * */ public function __construct($config = array()) { // Creating Guzzle instances $httpClient = new GuzzleClient($config); $configDirectories = array(__DIR__ . "/" . self::RESOURCES_PATH); $locator = new FileLocator($configDirectories); $jsonLoader = new JsonLoader($locator); $description = $jsonLoader->load($locator->locate(self::RESOURCES_FILE)); $description = new GuzzleDescription($description); parent::__construct($httpClient, $description); $this->getEmitter()->attach(new PathListener()); $this->registerStreamWrapper(); }