Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
9 / 9 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
TestPreviewerConfigurationService | |
100.00% |
9 / 9 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
getConfiguration | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getProviderService | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTestRunnerPluginService | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTestRunnerConfigurationService | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMapper | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
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) 2020 (original work) Open Assessment Technologies SA |
19 | */ |
20 | |
21 | declare(strict_types=1); |
22 | |
23 | namespace oat\taoQtiTestPreviewer\models\testConfiguration\service; |
24 | |
25 | use oat\oatbox\service\ConfigurableService; |
26 | use oat\taoQtiTest\models\runner\config\QtiRunnerConfig; |
27 | use oat\taoQtiTestPreviewer\models\testConfiguration\mapper\TestPreviewerConfigurationMapper; |
28 | use oat\taoQtiTestPreviewer\models\testConfiguration\TestPreviewerConfig; |
29 | use oat\taoTests\models\runner\plugins\TestPluginService; |
30 | use oat\taoTests\models\runner\providers\TestProviderService; |
31 | |
32 | class TestPreviewerConfigurationService extends ConfigurableService |
33 | { |
34 | public function getConfiguration(): TestPreviewerConfig |
35 | { |
36 | return $this->getMapper()->map( |
37 | $this->getProviderService()->getAllProviders(), |
38 | $this->getTestRunnerPluginService()->getAllPlugins(), |
39 | $this->getTestRunnerConfigurationService()->getConfig() |
40 | ); |
41 | } |
42 | |
43 | private function getProviderService(): TestProviderService |
44 | { |
45 | return $this->getServiceLocator()->get(TestProviderService::SERVICE_ID); |
46 | } |
47 | |
48 | private function getTestRunnerPluginService(): TestPluginService |
49 | { |
50 | return $this->getServiceLocator()->get(TestPluginService::SERVICE_ID); |
51 | } |
52 | |
53 | private function getTestRunnerConfigurationService(): QtiRunnerConfig |
54 | { |
55 | return $this->getServiceLocator()->get(QtiRunnerConfig::SERVICE_ID); |
56 | } |
57 | |
58 | private function getMapper(): TestPreviewerConfigurationMapper |
59 | { |
60 | return $this->getServiceLocator()->get(TestPreviewerConfigurationMapper::class); |
61 | } |
62 | } |