Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
TestProviderService
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 createFromArray
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
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) 2017 (original work) Open Assessment Technologies SA;
19 */
20
21namespace oat\taoTests\models\runner\providers;
22
23use oat\tao\model\providers\AbstractProviderService;
24use oat\tao\model\providers\ProviderModule;
25
26/**
27 * Manage test providers
28 *
29 * @author Bertrand Chevrier <bertrand@taotesting.com>
30 * @author Jean-Sébastien Conan <jean-sebastien@taotesting.com>
31 */
32class TestProviderService extends AbstractProviderService
33{
34    public const SERVICE_ID = 'taoTests/TestProvider';
35
36    /**
37     * TestProviderService constructor.
38     * @param array $options
39     */
40    public function __construct($options = [])
41    {
42        parent::__construct($options);
43        $this->setRegistry(ProviderRegistry::getRegistry());
44    }
45
46    /**
47     * Creates a provider object from data array
48     * @param $data
49     * @return ProviderModule
50     * @throws \common_exception_InconsistentData
51     */
52    protected function createFromArray($data)
53    {
54        return TestProvider::fromArray($data);
55    }
56}