Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 38... Línea 38...
38
 *
38
 *
39
 * @package enrol_lti
39
 * @package enrol_lti
40
 * @copyright 2016 Jun Pataleta <jun@moodle.com>
40
 * @copyright 2016 Jun Pataleta <jun@moodle.com>
41
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
42
 */
42
 */
43
class tool_provider_test extends \advanced_testcase {
43
final class tool_provider_test extends \advanced_testcase {
Línea 44... Línea 44...
44
 
44
 
45
    /**
45
    /**
46
     * @var \stdClass $tool The LTI tool.
46
     * @var \stdClass $tool The LTI tool.
47
     */
47
     */
Línea 52... Línea 52...
52
     *
52
     *
53
     * This is executed before running any tests in this file.
53
     * This is executed before running any tests in this file.
54
     */
54
     */
55
    public function setUp(): void {
55
    public function setUp(): void {
56
        global $SESSION;
56
        global $SESSION;
-
 
57
        parent::setUp();
57
        $this->resetAfterTest();
58
        $this->resetAfterTest();
Línea 58... Línea 59...
58
 
59
 
Línea 59... Línea 60...
59
        manager::init_empty_session();
60
        manager::init_empty_session();
Línea 204... Línea 205...
204
        $consumer->consumerName = 'TEST CONSUMER INSTANCE NAME';
205
        $consumer->consumerName = 'TEST CONSUMER INSTANCE NAME';
205
        $consumer->consumerGuid = 'TEST CONSUMER INSTANCE GUID';
206
        $consumer->consumerGuid = 'TEST CONSUMER INSTANCE GUID';
206
        $consumer->consumerVersion = 'TEST CONSUMER INFO VERSION';
207
        $consumer->consumerVersion = 'TEST CONSUMER INFO VERSION';
207
        $consumer->enabled = true;
208
        $consumer->enabled = true;
208
        $consumer->protected = true;
209
        $consumer->protected = true;
209
        $profilejson = file_get_contents(__DIR__ . '/fixtures/tool_consumer_profile.json');
210
        $profilejson = file_get_contents(self::get_fixture_path(__NAMESPACE__, 'tool_consumer_profile.json'));
210
        $consumer->profile = json_decode($profilejson);
211
        $consumer->profile = json_decode($profilejson);
211
        $consumer->save();
212
        $consumer->save();
Línea 212... Línea 213...
212
 
213
 
213
        $tp = new dummy_tool_provider($tool->id);
214
        $tp = new dummy_tool_provider($tool->id);
Línea 237... Línea 238...
237
        $consumer->consumerName = 'TEST CONSUMER INSTANCE NAME';
238
        $consumer->consumerName = 'TEST CONSUMER INSTANCE NAME';
238
        $consumer->consumerGuid = 'TEST CONSUMER INSTANCE GUID';
239
        $consumer->consumerGuid = 'TEST CONSUMER INSTANCE GUID';
239
        $consumer->consumerVersion = 'TEST CONSUMER INFO VERSION';
240
        $consumer->consumerVersion = 'TEST CONSUMER INFO VERSION';
240
        $consumer->enabled = true;
241
        $consumer->enabled = true;
241
        $consumer->protected = true;
242
        $consumer->protected = true;
242
        $profilejson = file_get_contents(__DIR__ . '/fixtures/tool_consumer_profile.json');
243
        $profilejson = file_get_contents(self::get_fixture_path(__NAMESPACE__, 'tool_consumer_profile.json'));
243
        $consumer->profile = json_decode($profilejson);
244
        $consumer->profile = json_decode($profilejson);
244
        $consumer->save();
245
        $consumer->save();
Línea 245... Línea 246...
245
 
246
 
246
        $tp = new dummy_tool_provider($tool->id);
247
        $tp = new dummy_tool_provider($tool->id);