Skip to content
Snippets Groups Projects
Commit 9c5fe758 authored by Laurent's avatar Laurent
Browse files

hotline #47505 test fix

parent 93f2507d
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!2061Master,!1995hotline #47505 : CDScript consult link: with no identity, consult link is ajax-login
Pipeline #306 passed with stage
in 8 minutes and 33 seconds
......@@ -24,8 +24,7 @@ class Class_WebService_SIGB_CdScript {
protected static $service;
public static function getService($params){
if (!isset(static::$service)) {
if (!static::$service) {
$instance = new static();
$classname = get_called_class().'_Service';
static::$service = $classname::getService($params['server_url'],
......@@ -35,5 +34,9 @@ class Class_WebService_SIGB_CdScript {
return static::$service;
}
public static function resetService() {
static::$service = null;
}
}
?>
\ No newline at end of file
......@@ -27,6 +27,7 @@ abstract class NoticeAjaxControllerCdScriptRecordTestCase extends AbstractContro
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$config = Class_Profil::getCurrentProfil()->getCfgNoticeAsArray();
$config['exemplaires']['grouper'] = '1';
......@@ -60,11 +61,34 @@ abstract class NoticeAjaxControllerCdScriptRecordTestCase extends AbstractContro
'remote_library_id' => 2])
->setTimeSource(new TimeSourceForTest('2015-10-28 09:00:00'));
}
public function tearDown() {
Class_WebService_SIGB_CdScript::resetService();
parent::tearDown();
}
}
class NoticeAjaxControllerCdScriptRecordWithoutLoginTest extends NoticeAjaxControllerCdScriptRecordTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/opac/noticeajax/exemplaires/id_notice/2', true);
}
/** @test */
public function availabilityShouldContainsLinkToAjaxLogin() {
$this->assertXPathContentContains('//table//td/a[contains(@href, "auth/ajax-login")]',
'Description en ligne',
$this->_response->getBody());
}
}
class NoticeAjaxControllerCdScriptRecordAsPaulTest extends NoticeAjaxControllerCdScriptRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -106,23 +130,4 @@ class NoticeAjaxControllerCdScriptRecordAsPaulTest extends NoticeAjaxControllerC
$this->assertXPathContentContains('//script', 'setupAnchorsTarget');
}
}
class NoticeAjaxControllerCdScriptRecordWithoutLoginTest extends NoticeAjaxControllerCdScriptRecordTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('/opac/noticeajax/exemplaires/id_notice/2', true);
}
/** @test */
public function availabilityShouldContainsLinkToAjaxLogin() {
$this->assertXPathContentContains('//table//td/a[contains(@href, "auth/ajax-login")]',
'Description en ligne');
}
}
?>
\ No newline at end of file
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