1 | <?php |
||
2 | |||
3 | namespace SilverStripe\ModuleRatings\Tests\Check; |
||
4 | |||
5 | use PHPUnit\Framework\TestCase; |
||
6 | use SilverStripe\ModuleRatings\Check\CodeCoverageGoodCheck; |
||
7 | |||
8 | class CodeCoverageGoodCheckTest extends TestCase |
||
9 | { |
||
10 | /** |
||
11 | * @covers \SilverStripe\ModuleRatings\Check\CodeCoverageGoodCheck::run |
||
12 | * @covers \SilverStripe\ModuleRatings\Check\CodeCoverageGreatCheck::run |
||
13 | * |
||
14 | * @param float $coverage |
||
15 | * @param bool $expected |
||
16 | * @dataProvider checkProvider |
||
17 | */ |
||
18 | public function testCheck($coverage, $expected) |
||
19 | { |
||
20 | $check = $this->getMockBuilder(CodeCoverageGoodCheck::class) |
||
0 ignored issues
–
show
|
|||
21 | ->setMethods(['getCoverage']) |
||
22 | ->getMock(); |
||
23 | |||
24 | $check->expects($this->once())->method('getCoverage')->willReturn($coverage); |
||
25 | |||
26 | $check->run(); |
||
27 | |||
28 | $this->assertSame($expected, $check->getSuccessful()); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return array[] |
||
33 | */ |
||
34 | public function checkProvider() |
||
35 | { |
||
36 | return [ |
||
37 | 'low_coverage' => [10, false], |
||
38 | 'even_coverage' => [40, true], |
||
39 | 'higher_coverage' => [99, true], |
||
40 | ]; |
||
41 | } |
||
42 | } |
||
43 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.