mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-03 14:54:01 +01:00
30 lines
722 B
PHP
30 lines
722 B
PHP
<?php
|
|
|
|
namespace Roundcube\Tests\Rcmail;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use function Roundcube\Tests\invokeMethod;
|
|
|
|
/**
|
|
* Test class to test rcmail_string_replacer class
|
|
*/
|
|
class StringReplacerTest extends TestCase
|
|
{
|
|
/**
|
|
* Test for mailto_callback() method
|
|
*/
|
|
public function test_mailto_callback()
|
|
{
|
|
$replacer = new \rcmail_string_replacer();
|
|
|
|
$result = invokeMethod($replacer, 'mailto_callback', [['email@address.com', 'email@address.com']]);
|
|
|
|
$this->assertMatchesRegularExpression($replacer->pattern, $result);
|
|
|
|
$result = invokeMethod($replacer, 'mailto_callback', [['address.com', 'address.com']]);
|
|
|
|
$this->assertSame('address.com', $result);
|
|
}
|
|
}
|