Skip to content
Snippets Groups Projects
Commit 812bab36 authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

Merge branch '8.0.161' into 'master'

fix Error 500 for interviews following move of files

See merge request !4502
parents 61e9857e 9172688d
Branches
Tags
1 merge request!4502fix Error 500 for interviews following move of files
Pipeline #17890 failed with stage
in 17 minutes and 14 seconds
......@@ -46,7 +46,9 @@ class Class_WebService_Afi extends Class_WebService_Abstract {
TRAILER_ENABLED = 0,
TRAILER_DISABLED = 1;
protected static $_key;
protected static
$_key,
$_should_throw_error;
/** @category testing */
public static function setKey($key) {
......@@ -61,6 +63,11 @@ class Class_WebService_Afi extends Class_WebService_Abstract {
}
public static function shouldThrowError($should) {
static::$_should_throw_error = $should;
}
public function getBiography($args) {
return array_merge(['statut_recherche' => 1,
'erreur' => '',
......@@ -252,6 +259,10 @@ class Class_WebService_Afi extends Class_WebService_Abstract {
$url = $url_service . '?' . http_build_query($args);
if (static::$_should_throw_error)
return $response = $this->httpGet($url, $options);
try {
$response = $this->httpGet($url, $options);
static::_goGoGadgetoLog();
......
......@@ -43,6 +43,6 @@ class Intonation_View_RenderInterviews extends ZendAfi_View_Helper_BaseHelper {
$interview->getDescription())));
};
return $this->view->renderCarousel($interviews, $callback);
return $this->view->layoutCarousel($interviews, $callback);
}
}
......@@ -1476,6 +1476,31 @@ class TemplatesDispatchRecordAuthorTest extends TemplatesIntonationTestCase {
'type_doc' => 8,
'clef_oeuvre' => 'THE BOOK OF SOULS',
'facettes' => 'G13 M12 A2408']);
$httpClient =
$this->mock()
->whenCalled('open_url')
->with('https://www.youtube.com/feeds/videos.xml?channel_id=123')
->answers('')
->whenCalled('open_url')
->with('https://cache.org?auteur=Iron+Maiden&width=500&src=99aed22943ef35851f70f99965a44690&api=2.0&action=7')
->answers(['source' => 'http://ina.fr',
'videos' => [['titre' =>'abcdef',
'player' => 'src="http://mycontent.org/interview"',
'contenu'=>'Mycontent']]
])
->beStrict();
Class_CosmoVar::setValueOf('url_services', 'https://cache.org');
Class_WebService_Afi::shouldThrowError(true);
Class_WebService_Afi::setHttpClient($httpClient);
}
public function tearDown() {
Class_WebService_Afi::shouldThrowError(false);
Class_WebService_Afi::setHttpClient(null);
parent::tearDown();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment