mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-11 16:49:09 +00:00
Add unit test for Search class
Bug: T315764 Change-Id: Ibc5e65bd2bc2ab8d667ead8428a20d3c66f72f99
This commit is contained in:
parent
bc85753b87
commit
ee40a242a4
19
tests/phpunit/unit/SearchTest.php
Normal file
19
tests/phpunit/unit/SearchTest.php
Normal 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 );
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue