Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / ShowSiteStatsTest.php
blob22046dd512f68572a1f7620fe3005b9d67b163cb
1 <?php
3 namespace MediaWiki\Tests\Maintenance;
5 use ShowSiteStats;
7 /**
8 * @covers \ShowSiteStats
9 * @group Database
10 * @author Dreamy Jazz
12 class ShowSiteStatsTest extends MaintenanceBaseTestCase {
14 protected function getMaintenanceClass() {
15 return ShowSiteStats::class;
18 public function testExecute() {
19 $this->maintenance->execute();
20 $this->expectOutputString(
21 "Total edits : 123\n" .
22 "Number of articles: 12\n" .
23 "Total pages : 20\n" .
24 "Number of users : 14\n" .
25 "Active users : 4\n" .
26 "Number of images : 3\n"
30 public function addDBData() {
31 // Add test data to the site_stats table.
32 $this->getDb()->newReplaceQueryBuilder()
33 ->table( 'site_stats' )
34 ->row( [
35 'ss_row_id' => 1,
36 'ss_total_edits' => 123,
37 'ss_good_articles' => 12,
38 'ss_total_pages' => 20,
39 'ss_users' => 14,
40 'ss_active_users' => 4,
41 'ss_images' => 3,
42 ] )
43 ->uniqueIndexFields( [ 'ss_row_id' ] )
44 ->caller( __METHOD__ )
45 ->execute();