Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Overwriting App.fullBaseURL if changed using Router::baseURL()

  • Loading branch information...
commit 7b746ccb577de6193a6827bb71d46db300f1b355 1 parent 4bc92b8
@lorenzo lorenzo authored
View
1  lib/Cake/Routing/Router.php
@@ -920,6 +920,7 @@ public static function url($url = null, $full = false) {
public static function baseURL($base = null) {
if ($base !== null) {
self::$_baseURL = $base;
+ Configure::write('App.fullBaseURL', $base);
}
if (empty(self::$_baseURL)) {
self::$_baseURL = Configure::read('App.fullBaseURL');
View
3  lib/Cake/Test/Case/Routing/RouterTest.php
@@ -50,6 +50,7 @@ public function tearDown() {
parent::tearDown();
CakePlugin::unload();
Router::baseURL('');
+ Configure::write('App.fullBaseURL', 'http://localhost');
}
/**
@@ -73,8 +74,10 @@ public function testBaseURL() {
$this->assertEquals(FULL_BASE_URL, Router::baseUrl());
Router::baseURL('http://example.com');
$this->assertEquals('http://example.com/', Router::url('/', true));
+ $this->assertEquals('http://example.com', Configure::read('App.fullBaseURL'));
Router::baseURL('https://example.com');
$this->assertEquals('https://example.com/', Router::url('/', true));
+ $this->assertEquals('https://example.com', Configure::read('App.fullBaseURL'));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.