+ $this->assertGreaterThan( 0, $checkIds[1], "Second edit hook rev ID set" );
+ $this->assertGreaterThan( $checkIds[0], $checkIds[1], "Second event rev ID is higher" );
+ }
+
+ public function testUpdatePageTrx() {
+ $text = "one";
+ $edit = [
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'first update',
+ ];
+
+ $page = $this->assertEdit( 'EditPageTest_testTrxUpdatePage', "zero", null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $text,
+ "expected successfull update with given text" );
+
+ $this->forceRevisionDate( $page, '20120101000000' );
+
+ $checkIds = [];
+ $this->setMwGlobals( 'wgHooks', [
+ 'PageContentSaveComplete' => [ function (
+ WikiPage &$page, User &$user, Content $content,
+ $summary, $minor, $u1, $u2, &$flags, Revision $revision,
+ Status &$status, $baseRevId
+ ) use ( &$checkIds ) {
+ $checkIds[] = $status->value['revision']->getId();
+ // types/refs checked
+ } ],
+ ] );
+
+ wfGetDB( DB_MASTER )->begin( __METHOD__ );
+
+ $text = "two";
+ $edit = [
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'second update',
+ ];
+
+ $this->assertEdit( 'EditPageTest_testTrxUpdatePage', null, null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $text,
+ "expected successfull update with given text" );
+
+ $text = "three";
+ $edit = [
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'third update',
+ ];
+
+ $this->assertEdit( 'EditPageTest_testTrxUpdatePage', null, null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $text,
+ "expected successfull update with given text" );
+
+ wfGetDB( DB_MASTER )->commit( __METHOD__ );
+
+ $this->assertGreaterThan( 0, $checkIds[0], "First event rev ID set" );
+ $this->assertGreaterThan( 0, $checkIds[1], "Second edit hook rev ID set" );
+ $this->assertGreaterThan( $checkIds[0], $checkIds[1], "Second event rev ID is higher" );