19declare(strict_types=1);
40 protected function setUp(): void
53 $this->createMock(TestTopListRepository::class),
58 $this->createMock(Factory::class),
60 TopListOrder::BY_SCORE,
61 $this->createMock(ParticipantRepository::class)
67 $this->assertInstanceOf(DataRetrieval::class, $this->tableObj);
72 $this->testObjMock->method(
'getHighscoreAchievedTS')->willReturn(
true);
73 $this->testObjMock->method(
'getHighscoreScore')->willReturn(
true);
74 $this->testObjMock->method(
'getHighscorePercentage')->willReturn(
true);
75 $this->testObjMock->method(
'getHighscoreWTime')->willReturn(
true);
77 $columns = $this->tableObj->getColumns();
78 $this->assertIsArray($columns);
79 $this->assertNotEmpty($columns);
80 $this->assertArrayHasKey(
'is_actor', $columns);
81 $this->assertArrayHasKey(
'rank', $columns);
82 $this->assertArrayHasKey(
'participant', $columns);
83 $this->assertArrayHasKey(
'achieved', $columns);
84 $this->assertArrayHasKey(
'score', $columns);
85 $this->assertArrayHasKey(
'percentage', $columns);
86 $this->assertArrayHasKey(
'workingtime', $columns);
91 $this->testObjMock->method(
'getHighscoreAchievedTS')->willReturn(
true);
92 $this->testObjMock->method(
'getHighscoreScore')->willReturn(
false);
93 $this->testObjMock->method(
'getHighscorePercentage')->willReturn(
true);
94 $this->testObjMock->method(
'getHighscoreWTime')->willReturn(
false);
96 $columns = $this->tableObj->getColumns();
97 $this->assertIsArray($columns);
98 $this->assertNotEmpty($columns);
99 $this->assertArrayHasKey(
'achieved', $columns);
100 $this->assertArrayHasKey(
'percentage', $columns);
102 $this->assertArrayNotHasKey(
'score', $columns);
103 $this->assertArrayNotHasKey(
'workingtime', $columns);
108 $this->assertEquals(
'00:00:00', $this->tableObj->formatTime(0));
113 $this->assertEquals(
'01:00:00', $this->tableObj->formatTime(3600));
114 $this->assertEquals(
'00:02:00', $this->tableObj->formatTime(120));
115 $this->assertEquals(
'00:02:01', $this->tableObj->formatTime(121));
116 $this->assertEquals(
'03:09:40', $this->tableObj->formatTime(11380));
test_formatTime_shouldReturnFormattedTime()
test_formatTime_shouldReturnZeroTime()
test_getColumns_shouldReturnAllColumns()
test_getColumns_shouldReturnOnlySelectedColumns()
test_instantiateObject_shouldReturnInstance()