Example #1
0
 public function testLoadPageRedirectExternal()
 {
     $response = $this->getResponseAjax(new CM_Page_View_Ajax_Test_Mock(), 'loadPage', ['path' => CM_Page_View_Ajax_Test_MockRedirect::getPath()]);
     $this->assertViewResponseSuccess($response, array('redirectExternal' => 'http://www.foo.bar'));
 }
Example #2
0
 public function testLoadPageRedirectDifferentHost()
 {
     $site = $this->getMockSite(null, null, ['url' => 'http://my-site.com/foo']);
     $page = new CM_Page_View_Ajax_Test_Mock();
     $env = new CM_Frontend_Environment($site, CMTest_TH::createUser());
     $params = ['path' => CM_Page_View_Ajax_Test_MockRedirect::getPath(), 'currentLayout' => $page->getLayout($env)];
     $response = $this->getResponseAjax($page, 'loadPage', $params);
     $this->assertViewResponseSuccess($response, array('redirectExternal' => 'http://www.foo.bar'));
 }