|
|
@@ -13,6 +13,7 @@
|
|
|
*/
|
|
|
namespace Cake\Test\TestCase\Utility;
|
|
|
|
|
|
+use Cake\I18n\Time;
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
use Cake\Utility\Text;
|
|
|
|
|
|
@@ -229,6 +230,14 @@ class TextTest extends TestCase
|
|
|
$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);
|
|
|
}
|
|
|
|
|
|
/**
|