MDL-81308 core: Use a helper for consecutive invocation counts
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
use PHPUnit\Framework\MockObject\Rule\InvocationOrder;
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
@@ -594,5 +595,17 @@ abstract class base_testcase extends PHPUnit\Framework\TestCase {
|
||||
|
||||
return str_replace(' ', ' ', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the count of invocation.
|
||||
*
|
||||
* This is required because the method to use changed names in PHPUnit 10.0 in a breaking change.
|
||||
*
|
||||
* @param \PHPUnit\Framework\MockObject\Rule\InvocationOrder $counter
|
||||
* @return int
|
||||
*/
|
||||
protected static function getInvocationCount(InvocationOrder $counter): int {
|
||||
return $counter->getInvocationCount();
|
||||
}
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user