2013-06-25 17:06:37 +00:00
|
|
|
<?php
|
2018-05-25 07:26:54 +00:00
|
|
|
|
2021-02-18 23:23:32 +00:00
|
|
|
namespace Resque\Test;
|
|
|
|
|
2013-06-25 17:06:37 +00:00
|
|
|
/**
|
2021-02-18 23:23:32 +00:00
|
|
|
* \Resque\Log tests.
|
2013-06-25 17:06:37 +00:00
|
|
|
*
|
2018-05-25 07:26:54 +00:00
|
|
|
* @package Resque/Tests
|
2021-02-18 23:23:32 +00:00
|
|
|
* @author Daniel Mason <daniel@m2.nz>
|
2018-05-25 07:26:54 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php
|
2013-06-25 17:06:37 +00:00
|
|
|
*/
|
2018-05-25 07:26:54 +00:00
|
|
|
|
2021-02-18 23:23:32 +00:00
|
|
|
class LogTest extends TestCase
|
2013-06-25 17:06:37 +00:00
|
|
|
{
|
2018-05-25 07:26:54 +00:00
|
|
|
public function testLogInterpolate()
|
|
|
|
{
|
2021-02-18 23:23:32 +00:00
|
|
|
$logger = new \Resque\Log();
|
2018-05-29 20:25:02 +00:00
|
|
|
$actual = $logger->interpolate('string {replace}', ['replace' => 'value']);
|
2018-05-25 07:26:54 +00:00
|
|
|
$expected = 'string value';
|
2013-06-25 17:06:37 +00:00
|
|
|
|
2018-05-25 07:26:54 +00:00
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
2013-06-25 17:06:37 +00:00
|
|
|
|
2018-05-25 07:26:54 +00:00
|
|
|
public function testLogInterpolateMutiple()
|
|
|
|
{
|
2021-02-18 23:23:32 +00:00
|
|
|
$logger = new \Resque\Log();
|
2018-05-25 07:26:54 +00:00
|
|
|
$actual = $logger->interpolate(
|
|
|
|
'string {replace1} {replace2}',
|
2018-05-29 20:25:02 +00:00
|
|
|
['replace1' => 'value1', 'replace2' => 'value2']
|
2018-05-25 07:26:54 +00:00
|
|
|
);
|
|
|
|
$expected = 'string value1 value2';
|
2013-06-25 17:06:37 +00:00
|
|
|
|
2018-05-25 07:26:54 +00:00
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
2013-06-25 17:06:37 +00:00
|
|
|
}
|