aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/CommentStoreCommentTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/CommentStoreCommentTest.php')
-rw-r--r--tests/phpunit/includes/CommentStoreCommentTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/phpunit/includes/CommentStoreCommentTest.php b/tests/phpunit/includes/CommentStoreCommentTest.php
new file mode 100644
index 000000000000..2dfe03ad6b81
--- /dev/null
+++ b/tests/phpunit/includes/CommentStoreCommentTest.php
@@ -0,0 +1,26 @@
+<?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() );
+ }
+
+}