31 $user = self::$users[
'sysop']->getUser();
32 $revid = array_shift( $this->revs );
34 'action' =>
'revisiondelete',
36 'target' => self::$page,
38 'hide' =>
'content|user|comment',
39 'token' => $user->getEditToken(),
43 $this->assertEquals(
$out[
'status'],
'Success' );
44 $this->assertArrayHasKey(
'items',
$out );
45 $item =
$out[
'items'][0];
46 $this->assertTrue( $item[
'userhidden'],
'userhidden' );
47 $this->assertTrue( $item[
'commenthidden'],
'commenthidden' );
48 $this->assertTrue( $item[
'texthidden'],
'texthidden' );
49 $this->assertEquals( $item[
'id'], $revid );
52 $rev = Revision::newFromId( $revid );
53 $this->assertEquals(
$rev->getContent( Revision::FOR_PUBLIC ),
null );
54 $this->assertEquals(
$rev->getComment( Revision::FOR_PUBLIC ),
'' );
55 $this->assertEquals(
$rev->getUser( Revision::FOR_PUBLIC ), 0 );
59 'action' =>
'revisiondelete',
61 'target' => self::$page,
63 'show' =>
'content|user|comment',
64 'token' => $user->getEditToken(),
68 $out2 = $out2[0][
'revisiondelete'];
69 $this->assertEquals( $out2[
'status'],
'Success' );
70 $this->assertArrayHasKey(
'items', $out2 );
71 $item = $out2[
'items'][0];
73 $this->assertFalse( $item[
'userhidden'],
'userhidden' );
74 $this->assertFalse( $item[
'commenthidden'],
'commenthidden' );
75 $this->assertFalse( $item[
'texthidden'],
'texthidden' );
77 $this->assertEquals( $item[
'id'], $revid );
79 $rev = Revision::newFromId( $revid );
80 $this->assertNotEquals(
$rev->getContent( Revision::FOR_PUBLIC ),
null );
81 $this->assertNotEquals(
$rev->getComment( Revision::FOR_PUBLIC ),
'' );
82 $this->assertNotEquals(
$rev->getUser( Revision::FOR_PUBLIC ), 0 );
86 $user = self::$users[
'sysop']->getUser();
87 $revid = array_shift( $this->revs );
90 'action' =>
'revisiondelete',
92 'target' => self::$page,
94 'hide' =>
'content|user|comment',
95 'token' => $user->getEditToken(),
99 'action' =>
'revisiondelete',
100 'type' =>
'revision',
101 'target' => self::$page,
104 'token' => $user->getEditToken(),
107 $this->assertEquals(
$out[
'status'],
'Success' );
108 $this->assertArrayHasKey(
'items',
$out );
109 $item =
$out[
'items'][0];
112 $this->assertTrue( $item[
'userhidden'],
'userhidden' );
113 $this->assertFalse( $item[
'commenthidden'],
'commenthidden' );
114 $this->assertTrue( $item[
'texthidden'],
'texthidden' );
115 $this->assertEquals( $item[
'id'], $revid );