Skip to content

Commit

Permalink
Adding a test for the StringTemplateTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Dec 20, 2013
1 parent 6e8752e commit 06a40f6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 47 additions & 0 deletions Cake/Test/TestCase/View/Helper/StringTemplateTraitTest.php
@@ -0,0 +1,47 @@
<?php
/**
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
* @since CakePHP(tm) v 1.2.0.4206
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\View\Helper;

use Cake\TestSuite\TestCase;
use Cake\View\Helper\StringTemplateTrait;
use Cake\View\Helper\StringTemplate;

/**
* PaginatorHelperTest class
*
*/
class StringTemplateTraitTest extends TestCase {

use StringTemplateTrait;

/**
* testInitStringTemplates
*
* @return void
*/
public function testInitStringTemplates() {
$templates = [
'text' => '<p>{{text}}</p>',
];
$this->_initStringTemplates($templates);
$result = $this->templates(null);
$this->assertEquals($result, [
'text' => '<p>{{text}}</p>'
]);
}

}
2 changes: 1 addition & 1 deletion Cake/View/Helper/StringTemplateTrait.php
Expand Up @@ -53,4 +53,4 @@ public function templates($templates = null) {
return $this->_templater->add($templates);
}

}
}

0 comments on commit 06a40f6

Please sign in to comment.