+
+ public function testPartiallyBlockedPage() {
+ $this->setExpectedApiException( 'apierror-blocked-partial' );
+
+ $user = static::getTestSysop()->getUser();
+
+ $block = new DatabaseBlock( [
+ 'address' => $user,
+ 'by' => static::getTestSysop()->getUser()->getId(),
+ 'sitewide' => false,
+ ] );
+
+ $block->setRestrictions( [
+ new PageRestriction( 0, Title::newFromText( self::$page )->getArticleID() )
+ ] );
+ $block->insert();
+
+ $revid = array_shift( $this->revs );
+
+ $this->doApiRequest( [
+ 'action' => 'revisiondelete',
+ 'type' => 'revision',
+ 'target' => self::$page,
+ 'ids' => $revid,
+ 'hide' => 'content|user|comment',
+ 'token' => $user->getEditToken(),
+ ] );
+ }