mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-79675 enrol_lti: fix mocks depending on previously untyped props
When $launch_id wasn't typed, it was ok to call the getter, but now that it is, php throws an error. Replaced with stub method.
This commit is contained in:
parent
4fda419e88
commit
c043c180de
@ -138,7 +138,7 @@ abstract class lti_advantage_testcase extends \advanced_testcase {
|
||||
?array $customparams = null, $aud = '123'): LtiMessageLaunch {
|
||||
|
||||
$mocklaunch = $this->getMockBuilder(LtiMessageLaunch::class)
|
||||
->onlyMethods(['getLaunchData'])
|
||||
->onlyMethods(['getLaunchData', 'getLaunchId'])
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$mocklaunch->expects($this->any())
|
||||
@ -246,6 +246,12 @@ abstract class lti_advantage_testcase extends \advanced_testcase {
|
||||
}
|
||||
));
|
||||
|
||||
$mocklaunch->expects($this->any())
|
||||
->method('getLaunchId')
|
||||
->will($this->returnCallback(function() {
|
||||
return uniqid('lti1p3_launch_', true);
|
||||
}));
|
||||
|
||||
return $mocklaunch;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user