mediawiki-extensions-Replac.../tests/phpunit/unit/SearchTest.php
TechieNK ee40a242a4 Add unit test for Search class
Bug: T315764
Change-Id: Ibc5e65bd2bc2ab8d667ead8428a20d3c66f72f99
2023-10-02 13:22:31 +00:00

20 lines
469 B
PHP

<?php
use MediaWiki\Extension\ReplaceText\Search;
/**
* @covers \MediaWiki\Extension\ReplaceText\Search
*/
class SearchTest extends \MediaWikiUnitTestCase {
public function testGetReplacedText() {
$text = "This is the line being tested";
$search = "line";
$replacement = "word";
$regex = false;
$op = Search::getReplacedText( $text, $search, $replacement, $regex );
$trueOp = "This is the word being tested";
$this->assertSame( $trueOp, $op );
}
}