���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/wiki.craftaro.com/tests/phpunit/unit/includes/Revision/ContributionsSegmentTest.php
���ѧ٧ѧ�
<?php namespace MediaWiki\Tests\Revision; use MediaWiki\Revision\ContributionsSegment; use MediaWiki\Revision\MutableRevisionRecord; use MockTitleTrait; class ContributionsSegmentTest extends \MediaWikiUnitTestCase { use MockTitleTrait; public function provideFlags() { yield [ [] ]; yield [ [ 'newest' => false, 'oldest' => true ] ]; yield [ [ 'newest' => true, 'oldest' => false, ] ]; yield [ [ 'newest' => false, 'oldest' => false ] ]; yield [ [ 'newest' => true, 'oldest' => true, ] ]; yield [ [ 'oldest' => true, ] ]; yield [ [ 'newest' => true, ] ]; yield [ [ 'oldest' => false, ] ]; yield [ [ 'newest' => false, ] ]; } /** * @dataProvider provideFlags * @covers \MediaWiki\Revision\ContributionsSegment */ public function testFlags( $flags ) { $contributionsSegment = new ContributionsSegment( [], [], null, null, [], $flags ); $this->assertSame( $flags['newest'] ?? false, $contributionsSegment->isNewest() ); $this->assertSame( $flags['oldest'] ?? false, $contributionsSegment->isOldest() ); } /** * @covers \MediaWiki\Revision\ContributionsSegment */ public function testConstruction() { $mockTitle = $this->makeMockTitle( 'Foo', [ 'id' => 1 ] ); $revisionRecords = [ new MutableRevisionRecord( $mockTitle ), new MutableRevisionRecord( $mockTitle ) ]; $before = 'before'; $after = 'after'; $tags = [ 3 => [ 'frob' ] ]; $deltas = [ 3 => -7, 5 => null ]; $contributionsSegment = new ContributionsSegment( $revisionRecords, $tags, $before, $after, $deltas ); $this->assertSame( $revisionRecords, $contributionsSegment->getRevisions() ); $this->assertSame( $tags[3], $contributionsSegment->getTagsForRevision( 3 ) ); $this->assertSame( [], $contributionsSegment->getTagsForRevision( 17 ) ); $this->assertSame( $before, $contributionsSegment->getBefore() ); $this->assertSame( $after, $contributionsSegment->getAfter() ); $this->assertFalse( $contributionsSegment->isNewest(), 'isNewest' ); $this->assertFalse( $contributionsSegment->isOldest(), 'isOldest' ); $this->assertSame( $deltas[3], $contributionsSegment->getDeltaForRevision( 3 ) ); $this->assertNull( $contributionsSegment->getDeltaForRevision( 5 ) ); $this->assertNull( $contributionsSegment->getDeltaForRevision( 77 ) ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�