Skip to content

Commit

Permalink
correct constructor and write expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Mar 27, 2014
1 parent c754f12 commit 2d573f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/View/StringTemplate.php
Expand Up @@ -59,7 +59,7 @@ class StringTemplate {
*
* @param array $templates A set of templates to add.
*/
public function __construct(array $config = null) {
public function __construct(array $config = []) {
$this->config($config, null, true);
}

Expand Down
6 changes: 5 additions & 1 deletion tests/TestCase/View/StringTemplateTest.php
Expand Up @@ -53,7 +53,11 @@ public function testAdd() {
'link' => '<a href="{{url}}">{{text}}</a>'
];
$result = $this->template->add($templates);
$this->assertNull($result, 'No return');
$this->assertSame(
$this->template,
$result,
'The same instance should be returned'
);

$this->assertEquals($templates['link'], $this->template->get('link'));
}
Expand Down

0 comments on commit 2d573f5

Please sign in to comment.