Merge "Use PHP 7 "\u{NNNN}" Unicode codepoint escapes in string literals (part 2)"
[lhc/web/wiklou.git] / tests / phpunit / includes / page / WikiPageDbTestBase.php
index 40c4e1e..68539b5 100644 (file)
@@ -96,6 +96,8 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
         * @covers WikiPage::doEditUpdates
         */
        public function testDoEditContent() {
+               $this->setMwGlobals( 'wgPageCreationLog', true );
+
                $page = $this->newPage( __METHOD__ );
                $title = $page->getTitle();
 
@@ -108,13 +110,21 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
 
                $page->doEditContent( $content, "[[testing]] 1" );
 
+               $id = $page->getId();
+
+               // Test page creation logging
+               $this->assertSelect(
+                       'logging',
+                       [ 'log_type', 'log_action' ],
+                       [ 'log_page' => $id ],
+                       [ [ 'create', 'create' ] ]
+               );
+
                $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" );
-               $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" );
+               $this->assertTrue( $id > 0, "WikiPage should have new page id" );
                $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" );
                $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" );
 
-               $id = $page->getId();
-
                # ------------------------
                $dbr = wfGetDB( DB_REPLICA );
                $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );