2013-06-25 17:06:37 +00:00
|
|
|
<?php
|
2018-05-25 07:26:54 +00:00
|
|
|
|
2013-06-25 17:06:37 +00:00
|
|
|
/**
|
|
|
|
* Resque_Log tests.
|
|
|
|
*
|
2018-05-25 07:26:54 +00:00
|
|
|
* @package Resque/Tests
|
|
|
|
* @author Chris Boulton <chris@bigcommerce.com>
|
|
|
|
* @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
|
|
|
|
2013-06-25 17:06:37 +00:00
|
|
|
class Resque_Tests_LogTest extends Resque_Tests_TestCase
|
|
|
|
{
|
2018-05-25 07:26:54 +00:00
|
|
|
public function testLogInterpolate()
|
|
|
|
{
|
|
|
|
$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()
|
|
|
|
{
|
|
|
|
$logger = new Resque_Log();
|
|
|
|
$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
|
|
|
}
|