Skip to content

Commit

Permalink
Dev: Fix for template test
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 16, 2017
1 parent ce68c8a commit 2407d29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/DummyController.php
Expand Up @@ -8,4 +8,11 @@ class DummyController extends \CController
* @var string
*/
public $sTemplate = 'dummyvalue';

/**
* Do nothing.
*/
public function redirect($url, $terminate = true, $statusCode = 302)
{
}
}
4 changes: 4 additions & 0 deletions tests/controllers/TemplateControllerTest.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 2407d29

Please sign in to comment.