Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 123 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
TestQtiServiceProvider | |
0.00% |
0 / 123 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__invoke | |
0.00% |
0 / 123 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2021-2024 (original work) Open Assessment Technologies SA; |
19 | */ |
20 | |
21 | declare(strict_types=1); |
22 | |
23 | namespace oat\taoQtiTest\model\Container; |
24 | |
25 | use oat\generis\model\data\Ontology; |
26 | use oat\generis\model\DependencyInjection\ContainerServiceProviderInterface; |
27 | use oat\oatbox\event\EventManager; |
28 | use oat\oatbox\log\LoggerService; |
29 | use oat\tao\model\featureFlag\FeatureFlagChecker; |
30 | use oat\taoDelivery\model\execution\DeliveryExecutionService; |
31 | use oat\taoDelivery\model\execution\StateServiceInterface; |
32 | use oat\taoDelivery\model\RuntimeService; |
33 | use oat\taoQtiTest\model\Domain\Model\ItemResponseRepositoryInterface; |
34 | use oat\taoQtiTest\model\Domain\Model\QtiTestRepositoryInterface; |
35 | use oat\taoQtiTest\model\Domain\Model\ToolsStateRepositoryInterface; |
36 | use oat\taoQtiTest\model\Infrastructure\QtiItemResponseRepository; |
37 | use oat\taoQtiTest\model\Infrastructure\QtiItemResponseValidator; |
38 | use oat\taoQtiTest\model\Infrastructure\QtiToolsStateRepository; |
39 | use oat\taoQtiTest\model\Infrastructure\QtiTestRepository; |
40 | use oat\taoQtiTest\model\Service\ConcurringSessionService; |
41 | use oat\taoQtiTest\model\Service\ExitTestService; |
42 | use oat\taoQtiTest\model\Service\ListItemsService; |
43 | use oat\taoQtiTest\model\Service\MoveService; |
44 | use oat\taoQtiTest\model\Service\PauseService; |
45 | use oat\taoQtiTest\model\Service\PluginManagerService; |
46 | use oat\taoQtiTest\model\Service\SkipService; |
47 | use oat\taoQtiTest\model\Service\StoreTraceVariablesService; |
48 | use oat\taoQtiTest\model\Service\TimeoutService; |
49 | use oat\taoQtiTest\models\runner\QtiRunnerService; |
50 | use oat\taoQtiTest\models\runner\time\TimerAdjustmentServiceInterface; |
51 | use oat\taoQtiTest\models\TestModelService; |
52 | use oat\taoQtiTest\models\TestSessionService; |
53 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
54 | use common_ext_ExtensionsManager as ExtensionsManager; |
55 | |
56 | use function Symfony\Component\DependencyInjection\Loader\Configurator\service; |
57 | |
58 | class TestQtiServiceProvider implements ContainerServiceProviderInterface |
59 | { |
60 | public function __invoke(ContainerConfigurator $configurator): void |
61 | { |
62 | $services = $configurator->services(); |
63 | |
64 | $services |
65 | ->set(ItemResponseRepositoryInterface::class, QtiItemResponseRepository::class) |
66 | ->public() |
67 | ->args( |
68 | [ |
69 | service(QtiRunnerService::SERVICE_ID), |
70 | service(FeatureFlagChecker::class), |
71 | service(QtiItemResponseValidator::class), |
72 | ] |
73 | ); |
74 | |
75 | $services |
76 | ->set(ToolsStateRepositoryInterface::class, QtiToolsStateRepository::class) |
77 | ->public() |
78 | ->args( |
79 | [ |
80 | service(QtiRunnerService::SERVICE_ID) |
81 | ] |
82 | ); |
83 | |
84 | $services |
85 | ->set(ListItemsService::class, ListItemsService::class) |
86 | ->public() |
87 | ->args( |
88 | [ |
89 | service(QtiRunnerService::SERVICE_ID), |
90 | service(LoggerService::SERVICE_ID) |
91 | ] |
92 | ); |
93 | |
94 | $services |
95 | ->set(ExitTestService::class, ExitTestService::class) |
96 | ->public() |
97 | ->args( |
98 | [ |
99 | service(QtiRunnerService::SERVICE_ID), |
100 | service(ItemResponseRepositoryInterface::class), |
101 | service(ToolsStateRepositoryInterface::class), |
102 | ] |
103 | ); |
104 | |
105 | $services |
106 | ->set(MoveService::class, MoveService::class) |
107 | ->public() |
108 | ->args( |
109 | [ |
110 | service(QtiRunnerService::SERVICE_ID), |
111 | service(ItemResponseRepositoryInterface::class), |
112 | service(ToolsStateRepositoryInterface::class), |
113 | ] |
114 | ); |
115 | |
116 | $services |
117 | ->set(PauseService::class, PauseService::class) |
118 | ->public() |
119 | ->args( |
120 | [ |
121 | service(QtiRunnerService::SERVICE_ID), |
122 | service(ItemResponseRepositoryInterface::class), |
123 | ] |
124 | ); |
125 | |
126 | $services |
127 | ->set(SkipService::class, SkipService::class) |
128 | ->public() |
129 | ->args( |
130 | [ |
131 | service(QtiRunnerService::SERVICE_ID), |
132 | service(ItemResponseRepositoryInterface::class), |
133 | service(ToolsStateRepositoryInterface::class), |
134 | ] |
135 | ); |
136 | |
137 | $services |
138 | ->set(StoreTraceVariablesService::class, StoreTraceVariablesService::class) |
139 | ->public() |
140 | ->args( |
141 | [ |
142 | service(QtiRunnerService::SERVICE_ID), |
143 | service(EventManager::SERVICE_ID), |
144 | service(LoggerService::SERVICE_ID), |
145 | ] |
146 | ); |
147 | |
148 | $services |
149 | ->set(TimeoutService::class, TimeoutService::class) |
150 | ->public() |
151 | ->args( |
152 | [ |
153 | service(QtiRunnerService::SERVICE_ID), |
154 | service(ItemResponseRepositoryInterface::class), |
155 | service(ToolsStateRepositoryInterface::class), |
156 | ] |
157 | ); |
158 | |
159 | $services |
160 | ->set(QtiTestRepositoryInterface::class, QtiTestRepository::class) |
161 | ->public() |
162 | ->args( |
163 | [ |
164 | service(Ontology::SERVICE_ID), |
165 | service(TestModelService::SERVICE_ID), |
166 | ] |
167 | ); |
168 | |
169 | $services |
170 | ->set(ConcurringSessionService::class, ConcurringSessionService::class) |
171 | ->public() |
172 | ->args( |
173 | [ |
174 | service(LoggerService::SERVICE_ID), |
175 | service(QtiRunnerService::SERVICE_ID), |
176 | service(RuntimeService::SERVICE_ID), |
177 | service(DeliveryExecutionService::SERVICE_ID), |
178 | service(FeatureFlagChecker::class), |
179 | service(StateServiceInterface::SERVICE_ID), |
180 | service(TestSessionService::SERVICE_ID), |
181 | service(TimerAdjustmentServiceInterface::SERVICE_ID), |
182 | ] |
183 | ); |
184 | |
185 | $services |
186 | ->set(QtiItemResponseValidator::class, QtiItemResponseValidator::class) |
187 | ->public(); |
188 | |
189 | $services |
190 | ->set(PluginManagerService::class, PluginManagerService::class) |
191 | ->args( |
192 | [ |
193 | service(Ontology::SERVICE_ID), |
194 | service(ExtensionsManager::SERVICE_ID), |
195 | ] |
196 | ) |
197 | ->public(); |
198 | } |
199 | } |