diff --git a/tests/DummyController.php b/tests/DummyController.php index f6411a385a4..5e8081091e7 100644 --- a/tests/DummyController.php +++ b/tests/DummyController.php @@ -8,4 +8,11 @@ class DummyController extends \CController * @var string */ public $sTemplate = 'dummyvalue'; + + /** + * Do nothing. + */ + public function redirect($url, $terminate = true, $statusCode = 302) + { + } } diff --git a/tests/controllers/TemplateControllerTest.php b/tests/controllers/TemplateControllerTest.php index 6147588e07f..92eb14f7ac2 100644 --- a/tests/controllers/TemplateControllerTest.php +++ b/tests/controllers/TemplateControllerTest.php @@ -31,9 +31,13 @@ public function testCopyTemplate() // Simulate a POST. $_POST['newname'] = $newname; $_POST['copydir'] = 'default'; + $_SERVER['SERVER_NAME'] = 'localhost'; $contr = new \templates(new DummyController('dummyid')); $contr->templatecopy(); + $template = \Template::model()->find('name = \'foobartest\''); + $this->assertNotEmpty($template); + $this->assertEquals('foobartest', $template->name); } /**