Passed
Push — master ( ea0ac9...54e0c4 )
by Robbie
01:44
created

CheckSuiteIntegrationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testRun() 0 6 1
1
<?php
2
3
namespace SilverStripe\ModuleRatings\Tests;
4
5
use PHPUnit\Framework\TestCase;
6
use SilverStripe\ModuleRatings\CheckSuite;
7
8
/**
9
 * @group integration
10
 */
11
class CheckSuiteIntegrationTest extends TestCase
12
{
13
    /**
14
     * @var CheckSuite
15
     */
16
    protected $checkSuite;
17
18
    protected function setUp()
19
    {
20
        parent::setUp();
21
22
        $this->checkSuite = new CheckSuite();
23
        $this->checkSuite->setModuleRoot(dirname(__FILE__) . '/TestModule');
24
    }
25
26
    /**
27
     * Runs a test check suite over the "TestModule" test module directory. Note that at this point this doesn't
28
     * stub the results from API based checks, but rather just ignores them because no repository slug is provided.
29
     */
30
    public function testRun()
31
    {
32
        $this->checkSuite->run();
33
34
        $this->assertEquals(55, $this->checkSuite->getScore());
35
        $this->assertEquals(0, $this->checkSuite->getCheckDetails()['travis_passing']['points']);
36
    }
37
}
38