Commit 0e9ce7fb authored by Laurent's avatar Laurent

dev #58112 delete constant ROOT_URL

parent 4a12a195
Pipeline #1123 failed with stage
in 10 minutes and 35 seconds
......@@ -285,7 +285,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
protected function _getGlobalVars() {
return [
'FORCE_HTTPS' => Class_AdminVar_Meta::newDefault($this->_('Forcer l\'accès au site par le protocole HTTPS. Nécessite l\'installation et la configuration appropriée du serveur Web'))->bePrivate(),
'FORCE_HTTPS' => Class_AdminVar_Meta::newOnOff($this->_('Forcer l\'accès au site par le protocole HTTPS. Nécessite l\'installation et la configuration appropriée du serveur Web'))->bePrivate(),
'NB_AFFICH_AVIS_PAR_AUTEUR' => Class_AdminVar_Meta::newDefault($this->_('Nombre d\'avis maximum à afficher par utilisateur.')),
'CLEF_GOOGLE_MAP' => Class_AdminVar_Meta::newDefault($this->_('Clef d\'activation pour le plan d\'accès google map. <a target="_blank" href="http://code.google.com/apis/maps/signup.html">Obtenir la clé google map</a>')),
'REGISTER_OK' => Class_AdminVar_Meta::newEncodedData($this->_('Texte visible par l\'internaute après son inscription.')),
......
......@@ -217,7 +217,7 @@ class Class_Newsletter extends Storm_Model_Abstract {
public function getUnsubscribeUrl() {
return 'http://' . $_SERVER['SERVER_NAME'] . BASE_URL
return Class_Url::siteUrl()
. '/newsletter/unsubscribe/newsletter/' . $this->getId()
. (($profil = Class_AdminVar::get('NEWSLETTER_ID_PROFIL')) ? '/id_profil/' . $profil : '')
. '/user/%user.id%/hash/%hash%';
......@@ -262,7 +262,7 @@ class Class_Newsletter extends Storm_Model_Abstract {
protected function _getRecordUrlWithoutRouter($record) {
return sprintf('http://%s/recherche/viewnotice/id/%d',
$_SERVER['SERVER_NAME'].BASE_URL,
Class_Url::siteUrl(),
$record->getId());
}
......
......@@ -34,7 +34,9 @@ class ZendAfi_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_
protected function _isRedirectedToHTTPS($request, $response) {
if (($_SERVER['HTTPS'] == 'on') || !Class_AdminVar::isModuleEnabled('FORCE_HTTPS'))
if ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on'))
||
!Class_AdminVar::isModuleEnabled('FORCE_HTTPS'))
return false;
$response->setRedirect(Class_Url::absolute(), 301);
......
......@@ -107,7 +107,7 @@ class LeKioskLinkModeSSOTest extends LeKioskLinkModeLinkTestCase {
/** @test */
public function linkShouldBeCasUrlWithLeKioskId() {
$url = 'https://apipros.lekiosk.com/login/cas?'
.'cas_fournisseur=' . urlencode(ROOT_URL . BASE_URL . '/cas-server-v10')
.'cas_fournisseur=' . urlencode(Class_Url::siteUrl() . '/cas-server-v10')
.'&id=29'
.'&ReturnUrl=';
......@@ -174,7 +174,7 @@ class LeKioskModulesControllerTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
$this->_expected_login_redirect = '/auth/login?redirect='.urlencode(ROOT_URL . BASE_URL . '/modules/lekiosk');
$this->_expected_login_redirect = '/auth/login?redirect='.urlencode(Class_Url::siteUrl() . '/modules/lekiosk');
LekioskAdminVars::activate();
}
......@@ -407,7 +407,7 @@ class LeKioskRenderAlbumFromRecordTest extends LekioskServiceTestCase {
public function linkCasShouldContainsAlbumSSOUrl() {
$this->_dispatchAlbum();
$url = 'https://apipros.lekiosk.com/login/cas?'
.'cas_fournisseur=' . urlencode(ROOT_URL . BASE_URL . '/cas-server-v10')
.'cas_fournisseur=' . urlencode(Class_Url::siteUrl() . '/cas-server-v10')
.'&id=29'
.'&ReturnUrl=Le-10-Sport-National-z1962566.aspx';
......
......@@ -76,7 +76,6 @@ class Bokeh_Engine {
Class_AdminVar::findAll();
defineConstant('ROOT_URL', Class_Url::rootUrl());
return $this->setupLanguage();
}
......
......@@ -124,6 +124,11 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
->newInstanceWithId('WORKFLOW')
->setValeur(0);
$admin_var_loader
->newInstanceWithId('FORCE_HTTPS')
->setValeur(0);
$admin_var_loader
->newInstanceWithId('TEXT_REPLACEMENTS')
->setValeur('');
......
......@@ -817,7 +817,7 @@ class Admin_AlbumControllerPostAlbumRenaissanceToPatrimoineFrbrNoTypeTest
'collection' => ['Ratm', 'Soad'],
'duration' => '00:04:08',
'distributor' => 'galoum',
'frbr_url' => [ROOT_URL . BASE_URL . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7'],
'frbr_url' => [Class_Url::siteUrl() . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7'],
'frbr_type' => ['']]);
}
......@@ -900,8 +900,8 @@ class Admin_AlbumControllerPostAlbumRenaissanceToPatrimoineTest
'collection' => ['Ratm', 'Soad'],
'duration' => '00:04:08',
'distributor' => 'galoum',
'frbr_url' => [ROOT_URL . BASE_URL . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
ROOT_URL . BASE_URL . '/recherche/viewnotice/id/9/id_notice/9/type_doc/1/clef/CEQUETUVEUXMAISENMAJUSCULE--ALEX--PATBATOR-2015-1?id_profil=7'],
'frbr_url' => [Class_Url::siteUrl() . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
Class_Url::siteUrl() . '/recherche/viewnotice/id/9/id_notice/9/type_doc/1/clef/CEQUETUVEUXMAISENMAJUSCULE--ALEX--PATBATOR-2015-1?id_profil=7'],
'frbr_type' => ['1:target', '2:source']]);
$this->new_album = Class_Album::findFirstBy(['order'=>'id desc']);
$this->new_notice = $this->new_album->getNotice();
......@@ -1068,20 +1068,20 @@ class Admin_AlbumControllerPostAlbumRenaissanceToPatrimoineTest
/** @test */
public function shouldHaveCreatedFrbrLinkForDiamantsEmpoisonnes() {
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['source' => Class_Url::siteUrl() . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
'type_id' => 1,
'source_type' => Class_FRBR_Link::TYPE_NOTICE,
'target' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/'.$this->new_album->getId(),
'target' => Class_Url::siteUrl() . '/bib-numerique/notice/id/'.$this->new_album->getId(),
'target_type' => Class_FRBR_Link::TYPE_ALBUM]));
}
/** @test */
public function shouldHaveCreatedFrbrLinkForCeQueTuVeuxMaisEnMajuscule() {
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/id/9/id_notice/9/type_doc/1/clef/CEQUETUVEUXMAISENMAJUSCULE--ALEX--PATBATOR-2015-1?id_profil=7',
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => Class_Url::siteUrl() . '/recherche/viewnotice/id/9/id_notice/9/type_doc/1/clef/CEQUETUVEUXMAISENMAJUSCULE--ALEX--PATBATOR-2015-1?id_profil=7',
'type_id' => 2,
'target_type' => Class_FRBR_Link::TYPE_NOTICE,
'source' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/'.$this->new_album->getId(),
'source' => Class_Url::siteUrl() . '/bib-numerique/notice/id/'.$this->new_album->getId(),
'source_type' => Class_FRBR_Link::TYPE_ALBUM]));
}
}
......@@ -1164,9 +1164,9 @@ abstract class Admin_AlbumControllerEditAlbumMesBDTestCase extends Admin_AlbumCo
$this->fixture('Class_FRBR_Link', ['id' => 34,
'type' => Class_FRBR_LinkType::find(1),
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/id/8/id_notice/8/type_doc/1/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7',
'source_type' => Class_FRBR_Link::TYPE_NOTICE,
'target' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/43/ido/DC023',
'target' => Class_Url::siteUrl() . '/bib-numerique/notice/id/43/ido/DC023',
'target_type' => Class_FRBR_Link::TYPE_ALBUM]);
Class_Album::find(43)
......@@ -1266,20 +1266,20 @@ class Admin_AlbumControllerEditAlbumMesBDPostFrbrModifyTest extends Admin_AlbumC
'collection' => ['Ratm', 'Soad'],
'duration' => '00:04:08',
'distributor' => 'galoum',
'frbr_url' => [ROOT_URL . BASE_URL . '/recherche/viewnotice/id/12/id_notice/12/type_doc/1/clef/ACESHIGH--IRONM---1984-1?id_profil=7'],
'frbr_url' => [Class_Url::siteUrl() . '/recherche/viewnotice/id/12/id_notice/12/type_doc/1/clef/ACESHIGH--IRONM---1984-1?id_profil=7'],
'frbr_type' => ['1:target']]);
}
/** @test */
public function shouldHaveOnlyOneFrbrLink() {
$this->assertEquals(1, Class_FRBR_Link::countBy(['target' => ROOT_URL . BASE_URL .'/bib-numerique/notice/id/43']));
$this->assertEquals(1, Class_FRBR_Link::countBy(['target' => Class_Url::siteUrl() .'/bib-numerique/notice/id/43']));
}
/** @test */
public function shouldSaveNewFrbrLink() {
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/id/12/id_notice/12/type_doc/1/clef/ACESHIGH--IRONM---1984-1?id_profil=7']));
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['source' => Class_Url::siteUrl() . '/recherche/viewnotice/id/12/id_notice/12/type_doc/1/clef/ACESHIGH--IRONM---1984-1?id_profil=7']));
}
......@@ -1586,7 +1586,7 @@ class Admin_AlbumControllerEditAlbumMesBDTest extends Admin_AlbumControllerEditA
/** @test */
public function frbrLinkDescShouldBePresent() {
$this->assertXPathContentContains('//script', '<a href=\\"' . str_replace('/', '\\/', ROOT_URL . BASE_URL) . '\\/recherche\\/viewnotice\\/id\\/8\\/id_notice\\/8\\/type_doc\\/1\\/clef\\/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7', $this->_response->getBody());
$this->assertXPathContentContains('//script', '<a href=\\"' . str_replace('/', '\\/', Class_Url::siteUrl()) . '\\/recherche\\/viewnotice\\/id\\/8\\/id_notice\\/8\\/type_doc\\/1\\/clef\\/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1?id_profil=7', $this->_response->getBody());
}
}
......@@ -3054,7 +3054,7 @@ class Admin_AlbumControllerAddAlbumToAjaxTest extends Admin_AlbumControllerTestC
/** @test */
public function frbrRecordLinkElementShouldContainRecordPermalink() {
$this->_xpath->assertXPath($this->_json->content, '//script', '"frbr_url":["'.str_replace('/', '\/', ROOT_URL.BASE_URL).'\/recherche\/viewnotice\/clef\/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1\/id\/8"');
$this->_xpath->assertXPath($this->_json->content, '//script', '"frbr_url":["'.str_replace('/', '\/', Class_Url::siteUrl()).'\/recherche\/viewnotice\/clef\/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1\/id\/8"');
}
}
......@@ -3072,7 +3072,7 @@ class Admin_AlbumControllerAddAlbumToAjaxPostTest extends Admin_AlbumControllerT
'status' => Class_Album::STATUS_DRAFT,
'type_doc_id' => 100,
'frbr_type' => ['1:source'],
'frbr_url' => [ROOT_URL.BASE_URL.'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']], true);
'frbr_url' => [Class_Url::siteUrl().'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']], true);
}
......@@ -3084,7 +3084,7 @@ class Admin_AlbumControllerAddAlbumToAjaxPostTest extends Admin_AlbumControllerT
/** @test */
public function shouldHaveCreatedFrbrLinkForBeforeTheFlood() {
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => ROOT_URL.BASE_URL.'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']));
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => Class_Url::siteUrl().'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']));
}
......@@ -3107,7 +3107,7 @@ class Admin_AlbumControllerAddAlbumToAjaxPostNoVisibleTest extends Admin_AlbumCo
'status' => Class_Album::STATUS_VALIDATED,
'type_doc_id' => 100,
'frbr_type' => ['1:source'],
'frbr_url' => [ROOT_URL.BASE_URL.'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']], true);
'frbr_url' => [Class_Url::siteUrl().'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']], true);
}
......@@ -3119,7 +3119,7 @@ class Admin_AlbumControllerAddAlbumToAjaxPostNoVisibleTest extends Admin_AlbumCo
/** @test */
public function shouldHaveCreatedFrbrLinkForDark() {
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => ROOT_URL.BASE_URL.'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']));
$this->assertNotNull(Class_FRBR_Link::findFirstBy(['target' => Class_Url::siteUrl().'/admin/recherche/viewnotice/id_notice/8/clef/DIAMANTSEMPOISONNES--HENRYA--PAYOT-2007-1/id/8']));
}
}
......
......@@ -21,6 +21,8 @@
require_once 'AdminAbstractControllerTestCase.php';
abstract class Admin_FrbrLinkControllerTestCase extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
Storm_Model_Loader::defaultToVolatile();
......@@ -50,20 +52,20 @@ abstract class Admin_FrbrLinkControllerTestCase extends Admin_AbstractController
$this->fixture('Class_FRBR_Link',
['id' => 2,
'type' => $type,
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-1?id_profil=1&type_doc=4',
'target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-2?id_profil=1&type_doc=4']);
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-1?id_profil=1&type_doc=4',
'target' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-2?id_profil=1&type_doc=4']);
$this->fixture('Class_FRBR_Link',
['id' => 3,
'type' => $type,
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/AMNESTYINTERNATIONAL--GRANTR--GAMMA-2002-1?id_profil=1&type_doc=4',
'target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/AMNESTYINTERNATIONAL--GRANTR--GAMMA-2002-2?id_profil=1&type_doc=4']);
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/AMNESTYINTERNATIONAL--GRANTR--GAMMA-2002-1?id_profil=1&type_doc=4',
'target' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/AMNESTYINTERNATIONAL--GRANTR--GAMMA-2002-2?id_profil=1&type_doc=4']);
$this->fixture('Class_FRBR_Link',
['id' => 43,
'type' => $type,
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-1?id_profil=1&type_doc=4',
'target' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/12']);
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/LESGRANDSTEXTESDEDROITINTERNATIONALPUBLIC--DUPUYP--DALLOZ-2010-1?id_profil=1&type_doc=4',
'target' => Class_Url::siteUrl() . '/bib-numerique/notice/id/12']);
}
......@@ -225,8 +227,8 @@ class Admin_FrbrLinkControllerEditSuiteValidWithLocalUrlsPostTest extends Admin_
$this->postDispatch('/admin/frbr-link/edit/id/2',
['type_id' => 3,
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/LES1000MOTSDELINFO-POURMIEUXCOMPRENDREE-COMBRESE--GALLIMARDJEUNESSE-2003-1/type_doc/1/id/44275',
'target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/1928--ELLINGTOND-VOLUME4-MEDIA7-1992-3?id_profil=1&type_doc=3'],
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/LES1000MOTSDELINFO-POURMIEUXCOMPRENDREE-COMBRESE--GALLIMARDJEUNESSE-2003-1/type_doc/1/id/44275',
'target' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/1928--ELLINGTOND-VOLUME4-MEDIA7-1992-3?id_profil=1&type_doc=3'],
true);
$this->_link = Class_FRBR_Link::find(2);
......
......@@ -736,8 +736,8 @@ class Admin_NewsletterControllerSendActionTest
[
['title', 'Animations'],
['body_text', 'Pour les jeunes
Lien pour se désinscrire de cette lettre d\'information : '. ROOT_URL . BASE_URL . '/newsletter/unsubscribe/newsletter/2/user/%user.id%/hash/%hash%'],
['body_html', 'Pour les jeunes<br/><a href="'. ROOT_URL . BASE_URL . '/newsletter/unsubscribe/newsletter/2/user/%user.id%/hash/%hash%">Je ne veux plus recevoir cette lettre d\'information</a>'],
Lien pour se désinscrire de cette lettre d\'information : http://localhost'. BASE_URL . '/newsletter/unsubscribe/newsletter/2/user/%user.id%/hash/%hash%'],
['body_html', 'Pour les jeunes<br/><a href="http://localhost'. BASE_URL . '/newsletter/unsubscribe/newsletter/2/user/%user.id%/hash/%hash%">Je ne veux plus recevoir cette lettre d\'information</a>'],
['sender', 'bokehrulez@linuxfr.org'],
['created_on', '2016-07-21 11:21:38']
];
......
......@@ -915,7 +915,7 @@ class CmsControllerViewNoticeMetasTest extends CmsControllerWithFeteDeLaFriteTes
/** @test */
public function pageShouldContainImageMeta() {
$this->assertXPath('//meta[@property="og:image"][@content="' . ROOT_URL . BASE_URL . '/userfiles/image/foo.jpg"]');
$this->assertXPath('//meta[@property="og:image"][@content="' . Class_Url::siteUrl() . '/userfiles/image/foo.jpg"]');
}
}
......
......@@ -123,7 +123,7 @@ class ModulesControllerKidilanguesNotLoggedTest extends ModulesControllerKidilan
/** @test */
public function shouldRedirectToLogin() {
$this->assertContains('/auth/login?redirect='.urlencode(ROOT_URL . BASE_URL . '/modules/kidilangues'),
$this->assertContains('/auth/login?redirect='.urlencode(Class_Url::siteUrl() . '/modules/kidilangues'),
$this->_response->getBody());
}
}
......
......@@ -20,6 +20,8 @@
*/
class ModulesControllerMyCowSsoTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->dispatch('/opac/modules/mycow-sso/eid/afi/uid/tom', true);
......@@ -53,6 +55,8 @@ class ModulesControllerMyCowSsoTest extends AbstractControllerTestCase {
class ModulesControllerMyCowNoAccessRightTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->dispatch('/opac/modules/mycow', true);
......@@ -68,6 +72,8 @@ class ModulesControllerMyCowNoAccessRightTest extends AbstractControllerTestCase
class ModulesControllerMyCowLoggedTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
......@@ -94,6 +100,8 @@ class ModulesControllerMyCowLoggedTest extends AbstractControllerTestCase {
class ModulesControllerMyCowNotLoggedTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
......@@ -105,7 +113,7 @@ class ModulesControllerMyCowNotLoggedTest extends AbstractControllerTestCase {
/** @test */
public function shouldRedirectToLogin() {
$this->assertContains('/auth/login?redirect='.urlencode(ROOT_URL . BASE_URL . '/modules/mycow'),
$this->assertContains('/auth/login?redirect='.urlencode(Class_Url::siteUrl() . '/modules/mycow'),
$this->_response->getBody());
}
}
......@@ -113,6 +121,8 @@ class ModulesControllerMyCowNotLoggedTest extends AbstractControllerTestCase {
class ModulesControllerMyCowDeactivateAndUserLoggedTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
RessourcesNumeriquesFixtures::deactivateMyCow();
......
......@@ -47,7 +47,7 @@ class ModulesControllerLoginRequiredTest extends AbstractControllerTestCase {
$this->dispatch('/opac/modules/' . $action);
$this->assertContains('/auth/login?redirect='.urlencode(ROOT_URL . BASE_URL . '/modules/' . $action),
$this->assertContains('/auth/login?redirect='.urlencode(Class_Url::siteUrl() . '/modules/' . $action),
$this->_response->getBody());
}
}
......@@ -147,7 +147,7 @@ class ModulesControllerLoginRequiredOrthodidacteTest extends AbstractControllerT
$this->dispatch('/opac/modules/orthodidacte');
$this->assertContains('/auth/login?redirect='.urlencode(ROOT_URL . BASE_URL . '/modules/orthodidacte'),
$this->assertContains('/auth/login?redirect='.urlencode(Class_Url::siteUrl() . '/modules/orthodidacte'),
$this->_response->getBody());
}
}
......
......@@ -331,7 +331,7 @@ class NoticeAjaxControllerResNumeriquesTest extends AbstractControllerTestCase {
abstract class NoticeAjaxControllerResNumeriquesFromFrbrLinkTestCase extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setup() {
parent::setup();
......@@ -362,20 +362,20 @@ abstract class NoticeAjaxControllerResNumeriquesFromFrbrLinkTestCase extends Abs
$this->fixture('Class_FRBR_Link',
['id' => 1,
'type_id' => 1,
'source' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'target' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/42']);
'source' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'target' => Class_Url::siteUrl() . '/bib-numerique/notice/id/42']);
$this->fixture('Class_FRBR_Link',
['id' => 2,
'type_id' => 2,
'target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'source' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/42']);
'target' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'source' => Class_Url::siteUrl() . '/bib-numerique/notice/id/42']);
$this->fixture('Class_FRBR_Link',
['id' => 3,
'type_id' => 2,
'target' => ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'source' => ROOT_URL . BASE_URL . '/bib-numerique/notice/id/43']);
'target' => Class_Url::siteUrl() . '/recherche/viewnotice/clef/ACESHIGH--IRONM---1984-1',
'source' => Class_Url::siteUrl() . '/bib-numerique/notice/id/43']);
}
}
......
......@@ -221,7 +221,7 @@ class RechercheControllerJsonWithResultTest extends RechercheControllerJsonTestC
/** @test */
public function secondThumbnailShouldBePresentAndAbsolute() {
$this->assertEquals(ROOT_URL . BASE_URL
$this->assertEquals(Class_Url::siteUrl()
. '/userfiles/album/154191/thumb_154191_e7bcedba-743a-11e2-a43d-fb3bf58b5f60.png',
$this->_second->thumbnail);
}
......
......@@ -222,7 +222,7 @@ class Telephone_RechercheControllerFrbrWithLinksTest extends TelephoneAbstractCo
}
protected function _getUrlForKey($key) {
return ROOT_URL . BASE_URL . '/recherche/viewnotice/clef/' . $key . '?Id_profil=1&type_doc=1';
return Class_Url::siteUrl() . '/recherche/viewnotice/clef/' . $key . '?Id_profil=1&type_doc=1';
}
......
......@@ -51,7 +51,6 @@ $parts = explode(DIRECTORY_SEPARATOR, $path);
$parts = array_reverse($parts);
defineConstant("BASE_URL", "/" . $parts[1]);
defineConstant('ROOT_URL', 'http://localhost');
defineConstant("URL_IMG", BASE_URL . "/public/opac/skins/original/images/");
defineConstant("URL_SHARED_IMG", BASE_URL . "/public/opac/images");
......
......@@ -74,6 +74,7 @@ abstract class ModelTestCase extends Storm_Test_ModelTestCase {
Storm_Model_Loader::defaultToVolatile();
$this->_registry_sql = Zend_Registry::get('sql');
Class_Url::setBaseUrl('/lla');
}
......
Markdown is supported
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