| Code Coverage | ||||||||||
| Lines | Functions and Methods | Classes and Traits | ||||||||
| Total |  | 0.00% | 0 / 6 |  | 0.00% | 0 / 1 | CRAP |  | 0.00% | 0 / 1 | 
| ReturnUrlService |  | 0.00% | 0 / 6 |  | 0.00% | 0 / 1 | 20 |  | 0.00% | 0 / 1 | 
| getReturnUrl |  | 0.00% | 0 / 6 |  | 0.00% | 0 / 1 | 20 | |||
| 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 | * | 
| 21 | */ | 
| 22 | |
| 23 | namespace oat\taoDelivery\models\classes; | 
| 24 | |
| 25 | use oat\oatbox\service\ConfigurableService; | 
| 26 | |
| 27 | class ReturnUrlService extends ConfigurableService | 
| 28 | { | 
| 29 | public const SERVICE_ID = 'taoDelivery/returnUrl'; | 
| 30 | |
| 31 | public const EXTENSION_OPTION = 'extension'; | 
| 32 | public const CONTROLLER_OPTION = 'controller'; | 
| 33 | public const METHOD_OPTION = 'method'; | 
| 34 | |
| 35 | /** | 
| 36 | * Get the full url to go at the end of a test | 
| 37 | * @param string $deliveryExecutionUri in case we need it in the params | 
| 38 | * @return string the full url | 
| 39 | */ | 
| 40 | public function getReturnUrl($deliveryExecutionUri = '') | 
| 41 | { | 
| 42 | |
| 43 | $ext = ($this->hasOption(self::EXTENSION_OPTION)) ? $this->getOption(self::EXTENSION_OPTION) : 'taoDelivery'; | 
| 44 | |
| 45 | $ctrl = ($this->hasOption(self::CONTROLLER_OPTION)) | 
| 46 | ? $this->getOption(self::CONTROLLER_OPTION) | 
| 47 | : 'DeliveryServer'; | 
| 48 | |
| 49 | $method = ($this->hasOption(self::METHOD_OPTION)) ? $this->getOption(self::METHOD_OPTION) : 'index'; | 
| 50 | |
| 51 | |
| 52 | return _url($method, $ctrl, $ext); | 
| 53 | } | 
| 54 | } |