Add unit test for Search class

Bug: T315764
Change-Id: Ibc5e65bd2bc2ab8d667ead8428a20d3c66f72f99
This commit is contained in:
TechieNK 2023-09-24 13:31:58 +05:30 committed by Yaron Koren
parent bc85753b87
commit ee40a242a4

View file

@ -0,0 +1,19 @@
<?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 );
}
}