diff --git a/Cake/Test/TestCase/View/Helper/StringTemplateTraitTest.php b/Cake/Test/TestCase/View/Helper/StringTemplateTraitTest.php new file mode 100644 index 00000000000..08c4ea7e6dd --- /dev/null +++ b/Cake/Test/TestCase/View/Helper/StringTemplateTraitTest.php @@ -0,0 +1,47 @@ + + * 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' => '

{{text}}

', + ]; + $this->_initStringTemplates($templates); + $result = $this->templates(null); + $this->assertEquals($result, [ + 'text' => '

{{text}}

' + ]); + } + +} diff --git a/Cake/View/Helper/StringTemplateTrait.php b/Cake/View/Helper/StringTemplateTrait.php index 5413f5171b7..ff4f0453f54 100644 --- a/Cake/View/Helper/StringTemplateTrait.php +++ b/Cake/View/Helper/StringTemplateTrait.php @@ -53,4 +53,4 @@ public function templates($templates = null) { return $this->_templater->add($templates); } -} \ No newline at end of file +}