ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
AttemptResultTest.php
Go to the documentation of this file.
1 <?php
2 
20 
23 
25 {
26  public static function getSettingsDataProvider(): array
27  {
28  return [
29  [new \ilTestPass()]
30  ];
31  }
32 
36  public function testGetActiveId(int $IO): void
37  {
38  $ilTestPassResult = new AttemptResult(
39  $IO,
40  0,
41  []
42  );
43  $this->assertEquals($IO, $ilTestPassResult->getActiveId());
44  }
45 
46  public static function getActiveIdDataProvider(): array
47  {
48  return [
49  [-1],
50  [0],
51  [1]
52  ];
53  }
54 
58  public function testGetAttempt(int $IO): void
59  {
60  $ilTestPassResult = new AttemptResult(
61  0,
62  $IO,
63  []
64  );
65  $this->assertEquals($IO, $ilTestPassResult->getAttempt());
66  }
67 
68  public static function getPassDataProvider(): array
69  {
70  return [
71  [-1],
72  [0],
73  [1]
74  ];
75  }
76 
80  public function testGetQuestionResults(\Closure $IO): void
81  {
82  $IO = $IO($this);
83  $ilTestPassResult = new AttemptResult(
84  0,
85  0,
86  $IO
87  );
88  $this->assertEquals($IO, $ilTestPassResult->getQuestionResults());
89  }
90 
91  public static function getQuestionResultsDataProvider(): array
92  {
93  return [
94  [static fn(self $test_case): array => []],
95  [static fn(self $test_case): array => [
96  $test_case->createMock(QuestionResult::class)
97  ]],
98  [static fn(self $test_case): array => [
99  $test_case->createMock(QuestionResult::class),
100  $test_case->createMock(QuestionResult::class),
101  ]]
102  ];
103 
104  }
105 }
testGetActiveId(int $IO)
getActiveIdDataProvider
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testGetQuestionResults(\Closure $IO)
getQuestionResultsDataProvider
Class ilTestBaseClass.