If a CommentStoreComment is constructed without a Message argument, then the RawMessage it uses instead should specify the comment text as a plain-text parameter, not as a regular parameter: we don’t want any syntax in the text to be interpreted at the Message level. Change-Id: If14debde2bceae695c8955604ee96bd5005d8b66
26 lines
566 B
PHP
26 lines
566 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* @covers CommentStoreComment
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class CommentStoreCommentTest extends TestCase {
|
|
|
|
public function testConstructorWithMessage() {
|
|
$message = new Message( 'test' );
|
|
$comment = new CommentStoreComment( null, 'test', $message );
|
|
|
|
$this->assertSame( $message, $comment->message );
|
|
}
|
|
|
|
public function testConstructorWithoutMessage() {
|
|
$text = '{{template|param}}';
|
|
$comment = new CommentStoreComment( null, $text );
|
|
|
|
$this->assertSame( $text, $comment->message->text() );
|
|
}
|
|
|
|
}
|