/** * @dataProvider getDataErrorResponses */ public function testError(array $response, $msg) { if ($msg) { $this->setExpectedException('RuntimeException', $msg); } $this->_sut->checkForApiResponseError($response); }
/** * {@inheritdoc} */ public function onAnalysisStart($feed, tubepress_api_url_UrlInterface $url) { $this->_skippedVideoCount = 0; $this->_feedAsArray = json_decode($feed, true); $this->_urlFetched = $url->getClone(); if ($this->_feedAsArray === null) { throw new RuntimeException('Unable to decode JSON from Dailymotion'); } if ($this->_shouldLog) { $this->_logDebug(sprintf('Decoded feed from Dailymotion is visible in the HTML source of this page.<span style="display:none">%s</span>', htmlspecialchars(print_r($this->_feedAsArray, true)))); } $this->_apiUtility->checkForApiResponseError($this->_feedAsArray); if (isset($this->_feedAsArray['id'])) { $item = $this->_feedAsArray; $this->_feedAsArray = array('list' => array($item)); } }