Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 17... Línea 17...
17
namespace core_cache;
17
namespace core_cache;
Línea 18... Línea 18...
18
 
18
 
19
/**
19
/**
20
 * PHPunit tests for the cache_helper class.
20
 * PHPunit tests for the cache_helper class.
21
 *
21
 *
22
 * @package    core
22
 * @package    core_cache
23
 * @category   cache
23
 * @category   cache
24
 * @copyright  2023 Andrew Lyons <andrew@nicols.co.uk>
24
 * @copyright  2023 Andrew Lyons <andrew@nicols.co.uk>
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 * @coversDefaultClass \cache_helper
26
 * @covers \core_cache\helper
27
 */
27
 */
28
class cache_helper_test extends \advanced_testcase {
28
final class cache_helper_test extends \advanced_testcase {
29
    /**
29
    /**
30
     * Test the result_found method.
30
     * Test the result_found method.
31
     *
31
     *
32
     * @param mixed $value
32
     * @param mixed $value
33
     * @param bool $expected
33
     * @param bool $expected
34
     * @dataProvider result_found_provider
-
 
35
     * @covers ::result_found
34
     * @dataProvider result_found_provider
36
     */
35
     */
37
    public function test_result_found($value, bool $expected): void {
36
    public function test_result_found($value, bool $expected): void {
38
        $this->assertEquals($expected, \cache_helper::result_found($value));
37
        $this->assertEquals($expected, helper::result_found($value));
Línea 39... Línea 38...
39
    }
38
    }
40
 
39
 
41
    /**
40
    /**
42
     * Data provider for result_found tests.
41
     * Data provider for result_found tests.
43
     *
42
     *
44
     * @return array
43
     * @return array
45
     */
44
     */
46
    public function result_found_provider(): array {
45
    public static function result_found_provider(): array {
47
        return [
46
        return [
Línea 48... Línea 47...
48
            // Only false values are considered as not found.
47
            // Only false values are considered as not found.