mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix issues with tests and "subfolder" URLs
This commit is contained in:
parent
790dff7b81
commit
99a8a81e9a
@ -328,7 +328,7 @@ class ControllerTest extends FunctionalTest {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public function testRedirectBackByReferer() {
|
public function testRedirectBackByReferer() {
|
||||||
$internalRelativeUrl = '/some-url';
|
$internalRelativeUrl = Controller::join_links(Director::baseURL(), '/some-url');
|
||||||
$internalAbsoluteUrl = Controller::join_links(Director::absoluteBaseURL(), '/some-url');
|
$internalAbsoluteUrl = Controller::join_links(Director::absoluteBaseURL(), '/some-url');
|
||||||
|
|
||||||
$response = $this->get('ControllerTest_Controller/redirectbacktest', null,
|
$response = $this->get('ControllerTest_Controller/redirectbacktest', null,
|
||||||
@ -354,7 +354,7 @@ class ControllerTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testRedirectBackByBackUrl() {
|
public function testRedirectBackByBackUrl() {
|
||||||
$internalRelativeUrl = '/some-url';
|
$internalRelativeUrl = Controller::join_links(Director::baseURL(), '/some-url');
|
||||||
$internalAbsoluteUrl = Controller::join_links(Director::absoluteBaseURL(), '/some-url');
|
$internalAbsoluteUrl = Controller::join_links(Director::absoluteBaseURL(), '/some-url');
|
||||||
|
|
||||||
$response = $this->get('ControllerTest_Controller/redirectbacktest?BackURL=' . urlencode($internalRelativeUrl));
|
$response = $this->get('ControllerTest_Controller/redirectbacktest?BackURL=' . urlencode($internalRelativeUrl));
|
||||||
|
@ -366,10 +366,11 @@ class RequirementsTest extends SapphireTest {
|
|||||||
$backend = new Requirements_Backend();
|
$backend = new Requirements_Backend();
|
||||||
$backend->set_suffix_requirements(false);
|
$backend->set_suffix_requirements(false);
|
||||||
$src = $this->getCurrentRelativePath() . '/RequirementsTest_a.js';
|
$src = $this->getCurrentRelativePath() . '/RequirementsTest_a.js';
|
||||||
|
$urlSrc = Controller::join_links(Director::baseURL(), $src);
|
||||||
$backend->javascript($src);
|
$backend->javascript($src);
|
||||||
$html = $backend->includeInHTML(false, $template);
|
$html = $backend->includeInHTML(false, $template);
|
||||||
$this->assertEquals('<html><head></head><body><!--<script>alert("commented out");</script>-->'
|
$this->assertEquals('<html><head></head><body><!--<script>alert("commented out");</script>-->'
|
||||||
. '<h1>more content</h1><script type="text/javascript" src="/' . $src . '"></script></body></html>', $html);
|
. '<h1>more content</h1><script type="text/javascript" src="' . $urlSrc . '"></script></body></html>', $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testForceJsToBottom() {
|
public function testForceJsToBottom() {
|
||||||
|
Loading…
Reference in New Issue
Block a user