Skip to content

Commit

Permalink
add object to text insert test case
Browse files Browse the repository at this point in the history
  • Loading branch information
steinkel committed Mar 30, 2017
1 parent d85909b commit a5185ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/TestCase/Utility/TextTest.php
Expand Up @@ -13,6 +13,7 @@
*/
namespace Cake\Test\TestCase\Utility;

use Cake\I18n\Time;
use Cake\TestSuite\TestCase;
use Cake\Utility\Text;

Expand Down Expand Up @@ -229,6 +230,14 @@ public function testInsert()
$expected = 'switching 10 by 5';
$result = Text::insert($string, ['timeout_count' => 10, 'timeout' => 5]);
$this->assertEquals($expected, $result);
$string = 'inserting a :user.email';
$expected = 'inserting a security@example.com';
$result = Text::insert($string, [
'user.email' => 'security@example.com',
'user.id' => 2,
'user.created' => Time::parse('2016-01-01')
]);
$this->assertEquals($expected, $result);
}

/**
Expand Down

0 comments on commit a5185ca

Please sign in to comment.