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

CheckSuiteIntegrationTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
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