Class DataRetrievalTest.  
 More...
◆ setUp()
  
  
      
        
          | Results\Toplist\DataRetrievalTest::setUp  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 39 of file DataRetrievalTest.php.
References $DIC.
   44         $this->addGlobal_ilCtrl();
    45         $this->addGlobal_lng();
    46         $this->addGlobal_ilUser();
    48         $this->testObjMock = $this->getTestObjMock();
    50         $this->tableObj = 
new DataRetrieval(
    52             $this->createMock(TestTopListRepository::class),
    57             $this->createMock(Factory::class),
    59             TopListOrder::BY_SCORE
 
 
 
 
◆ test_formatTime_shouldReturnFormattedTime()
      
        
          | Results\Toplist\DataRetrievalTest::test_formatTime_shouldReturnFormattedTime  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 113 of file DataRetrievalTest.php.
  115         $this->assertEquals(
'01:00:00', $this->tableObj->formatTime(3600));
   116         $this->assertEquals(
'00:02:00', $this->tableObj->formatTime(120));
   117         $this->assertEquals(
'00:02:01', $this->tableObj->formatTime(121));
   118         $this->assertEquals(
'03:09:40', $this->tableObj->formatTime(11380));
  
 
 
◆ test_formatTime_shouldReturnZeroTime()
      
        
          | Results\Toplist\DataRetrievalTest::test_formatTime_shouldReturnZeroTime  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 108 of file DataRetrievalTest.php.
  110         $this->assertEquals(
'00:00:00', $this->tableObj->formatTime(0));
  
 
 
◆ test_getColumns_shouldReturnAllColumns()
      
        
          | Results\Toplist\DataRetrievalTest::test_getColumns_shouldReturnAllColumns  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 68 of file DataRetrievalTest.php.
   70         $this->testObjMock->method(
'getHighscoreAchievedTS')->willReturn(
true);
    71         $this->testObjMock->method(
'getHighscoreScore')->willReturn(
true);
    72         $this->testObjMock->method(
'getHighscorePercentage')->willReturn(
true);
    73         $this->testObjMock->method(
'getHighscoreHints')->willReturn(
true);
    74         $this->testObjMock->method(
'getHighscoreWTime')->willReturn(
true);
    76         $columns = $this->tableObj->getColumns();
    77         $this->assertIsArray($columns);
    78         $this->assertNotEmpty($columns);
    79         $this->assertArrayHasKey(
'is_actor', $columns);
    80         $this->assertArrayHasKey(
'rank', $columns);
    81         $this->assertArrayHasKey(
'participant', $columns);
    82         $this->assertArrayHasKey(
'achieved', $columns);
    83         $this->assertArrayHasKey(
'score', $columns);
    84         $this->assertArrayHasKey(
'percentage', $columns);
    85         $this->assertArrayHasKey(
'hints', $columns);
    86         $this->assertArrayHasKey(
'workingtime', $columns);
  
 
 
◆ test_getColumns_shouldReturnOnlySelectedColumns()
      
        
          | Results\Toplist\DataRetrievalTest::test_getColumns_shouldReturnOnlySelectedColumns  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 89 of file DataRetrievalTest.php.
   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(
'getHighscoreHints')->willReturn(
true);
    95         $this->testObjMock->method(
'getHighscoreWTime')->willReturn(
false);
    97         $columns = $this->tableObj->getColumns();
    98         $this->assertIsArray($columns);
    99         $this->assertNotEmpty($columns);
   100         $this->assertArrayHasKey(
'achieved', $columns);
   101         $this->assertArrayHasKey(
'percentage', $columns);
   102         $this->assertArrayHasKey(
'hints', $columns);
   104         $this->assertArrayNotHasKey(
'score', $columns);
   105         $this->assertArrayNotHasKey(
'workingtime', $columns);
  
 
 
◆ test_instantiateObject_shouldReturnInstance()
      
        
          | Results\Toplist\DataRetrievalTest::test_instantiateObject_shouldReturnInstance  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 63 of file DataRetrievalTest.php.
   65         $this->assertInstanceOf(DataRetrieval::class, $this->tableObj);
  
 
 
◆ $tableObj
◆ $testObjMock
  
  
      
        
          | ilObjTest Results\Toplist\DataRetrievalTest::$testObjMock | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this class was generated from the following file: