Skip to content

Commit 47bb54b

Browse files
author
Frederik Ring
committed
test: add test for creation stats
1 parent 5b35a7f commit 47bb54b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/Jobs/PlatformStatsSummaryJobTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ protected function tearDown(): void {
3636
foreach ($this->wikis as $wiki) {
3737
$wiki['wiki']->wikiDb()->forceDelete();
3838
$wiki['wiki']->forceDelete();
39+
$wiki['user']->forceDelete();
3940
}
4041
parent::tearDown();
4142
}
@@ -164,6 +165,27 @@ public function testGroupings()
164165
$groups,
165166
);
166167
}
168+
function testCreationStats() {
169+
$mockJob = $this->createMock(Job::class);
170+
$mockJob->expects($this->never())->method('fail');
171+
172+
$job = new PlatformStatsSummaryJob();
173+
$job->setJob($mockJob);
167174

175+
$testWikis = [];
176+
$testUsers = [];
168177

178+
$stats = $job->getCreationStats();
179+
180+
$this->assertEquals(
181+
[
182+
'wikis_created_PT24H' => 0,
183+
'wikis_created_P30D' => 0,
184+
'users_created_PT24H' => 0,
185+
'users_created_P30D' => 0,
186+
],
187+
$stats,
188+
);
189+
190+
}
169191
}

0 commit comments

Comments
 (0)