Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 21... Línea 21...
21
 *
21
 *
22
 * @package   mlbackend_python
22
 * @package   mlbackend_python
23
 * @category  test
23
 * @category  test
24
 * @copyright 2019 David Mudrák <david@moodle.com>
24
 * @copyright 2019 David Mudrák <david@moodle.com>
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
 * @covers \mlbackend_python\processor
26
 */
27
 */
27
class processor_test extends \advanced_testcase {
28
final class processor_test extends \advanced_testcase {
28
 
-
 
29
    /**
29
    /**
30
     * Test implementation of the {@link \mlbackend_python\processor::check_pip_package_version()} method.
30
     * Test implementation of the {@link \mlbackend_python\processor::check_pip_package_version()} method.
31
     *
31
     *
32
     * @dataProvider check_pip_package_versions
32
     * @dataProvider check_pip_package_versions
33
     * @param string $actual A sample of the actual package version
33
     * @param string $actual A sample of the actual package version
Línea 40... Línea 40...
40
 
40
 
41
    /**
41
    /**
42
     * Check that the {@link \mlbackend_python\processor::check_pip_package_version()} can be called with single argument.
42
     * Check that the {@link \mlbackend_python\processor::check_pip_package_version()} can be called with single argument.
43
     */
43
     */
44
    public function test_check_pip_package_version_default(): void {
-
 
45
 
44
    public function test_check_pip_package_version_default(): void {
46
        $this->assertSame(-1, \mlbackend_python\processor::check_pip_package_version('0.0.1'));
45
        $this->assertSame(-1, \mlbackend_python\processor::check_pip_package_version('0.0.1'));
-
 
46
        $this->assertSame(
47
        $this->assertSame(0, \mlbackend_python\processor::check_pip_package_version(
47
            0,
-
 
48
            \mlbackend_python\processor::check_pip_package_version(\mlbackend_python\processor::REQUIRED_PIP_PACKAGE_VERSION),
48
            \mlbackend_python\processor::REQUIRED_PIP_PACKAGE_VERSION));
49
        );
Línea 49... Línea 50...
49
    }
50
    }
50
 
51
 
51
    /**
52
    /**
52
     * Provides data samples for the {@link self::test_check_pip_package_version()}.
53
     * Provides data samples for the {@link self::test_check_pip_package_version()}.
53
     *
54
     *
54
     * @return array
55
     * @return array
55
     */
56
     */
56
    public function check_pip_package_versions() {
57
    public static function check_pip_package_versions(): array {
57
        return [
58
        return [
58
            // Exact match.
59
            // Exact match.
59
            [
60
            [