Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a test for the StringTemplateTrait
- Loading branch information
Florian Krämer
committed
Dec 20, 2013
1 parent
6e8752e
commit 06a40f6
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Cake/Test/TestCase/View/Helper/StringTemplateTraitTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>' | ||
]); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,4 @@ public function templates($templates = null) { | |
return $this->_templater->add($templates); | ||
} | ||
|
||
} | ||
} |