Passed
Push — master ( 95d224...68f44f )
by Luke
02:40
created

MoodleVersionTestTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSatisfies() 0 8 1
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
use ComponentManager\MoodleVersion;
12
use PHPUnit\Framework\TestCase;
13
14
/**
15
 * @coversDefaultClass \ComponentManager\MoodleVersion
16
 */
17
class MoodleVersionTestTest extends TestCase {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
18
    public function testSatisfies() {
19
        $version = new MoodleVersion(
20
                '2017051502.06', '3.3.2+ (Build: 20171006)', '3.3', 200, '');
21
        $this->assertEquals(100, $version->satisfies('2017051502.06'));
22
        $this->assertEquals(100, $version->satisfies('3.3+'));
23
        $this->assertEquals(50, $version->satisfies('3.3'));
24
        $this->assertEquals(0, $version->satisfies('2017051502'));
25
    }
26
}
27