mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-04 15:24:02 +01:00
35 lines
766 B
PHP
35 lines
766 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test rcube_base_replacer class
|
|
*
|
|
* @package Tests
|
|
*/
|
|
class Framework_BaseReplacer extends PHPUnit_Framework_TestCase
|
|
{
|
|
|
|
/**
|
|
* Class constructor
|
|
*/
|
|
function test_class()
|
|
{
|
|
$object = new rcube_base_replacer('test');
|
|
|
|
$this->assertInstanceOf('rcube_base_replacer', $object, "Class constructor");
|
|
}
|
|
|
|
/**
|
|
* Test replace()
|
|
*/
|
|
function test_replace()
|
|
{
|
|
$base = 'http://thisshouldntbetheurl.bob.com/';
|
|
$html = '<A href=http://shouldbethislink.com>Test URL</A>';
|
|
|
|
$replacer = new rcube_base_replacer($base);
|
|
$response = $replacer->replace($html);
|
|
|
|
$this->assertSame('<A href="http://shouldbethislink.com">Test URL</A>', $response);
|
|
}
|
|
}
|