Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 27... Línea 27...
27
 * @package    core
27
 * @package    core
28
 * @category   test
28
 * @category   test
29
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
29
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
31
 */
32
class configonlylib_test extends \advanced_testcase {
32
final class configonlylib_test extends \advanced_testcase {
Línea 33... Línea 33...
33
 
33
 
34
    /**
34
    /**
35
     * Test cleaning of invalid utf-8 entities.
35
     * Test cleaning of invalid utf-8 entities.
36
     */
36
     */
Línea 145... Línea 145...
145
    }
145
    }
Línea 146... Línea 146...
146
 
146
 
147
    /**
147
    /**
148
     * Test the min_get_minimum_version function.
148
     * Test the min_get_minimum_version function.
149
     *
149
     *
150
     * @covers ::min_get_minimum_version
150
     * @covers ::min_get_minimum_revision
151
     */
151
     */
152
    public function test_min_get_minimum_version(): void {
152
    public function test_min_get_minimum_version(): void {
153
        // This is fairly hard to write a test for, but we can at least check that it returns a number
153
        // This is fairly hard to write a test for, but we can at least check that it returns a number
154
        // greater than the version when the feature was first introduced.
154
        // greater than the version when the feature was first introduced.
Línea 159... Línea 159...
159
    }
159
    }
Línea 160... Línea 160...
160
 
160
 
161
    /**
161
    /**
162
     * Test the min_get_maximum_version function.
162
     * Test the min_get_maximum_version function.
163
     *
163
     *
164
     * @covers ::min_get_maximum_version
164
     * @covers ::min_get_maximum_revision
165
     */
165
     */
166
    public function test_min_get_maximum_version(): void {
166
    public function test_min_get_maximum_version(): void {
167
        // The maximum version should be set to a time in the near future.
167
        // The maximum version should be set to a time in the near future.
168
        // This is currently defined as "in the next minute".
168
        // This is currently defined as "in the next minute".
Línea 184... Línea 184...
184
    /**
184
    /**
185
     * Data provider for the min_is_revision_valid_and_current tests.
185
     * Data provider for the min_is_revision_valid_and_current tests.
186
     *
186
     *
187
     * @return array
187
     * @return array
188
     */
188
     */
189
    public function min_is_revision_valid_and_current_provider(): array {
189
    public static function min_is_revision_valid_and_current_provider(): array {
190
        return [
190
        return [
191
            'Negative value' => [-1, false],
191
            'Negative value' => [-1, false],
192
            'Empty value' => [0, false],
192
            'Empty value' => [0, false],
193
            'A time before the minimum accepted value' => [min_get_minimum_revision() - 1, false],
193
            'A time before the minimum accepted value' => [min_get_minimum_revision() - 1, false],
194
            'The minimum accepted value' => [min_get_minimum_revision(), true],
194
            'The minimum accepted value' => [min_get_minimum_revision(), true],