-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathCodeCoverageExtensionSpec.php
56 lines (44 loc) · 1.55 KB
/
CodeCoverageExtensionSpec.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace spec\LeanPHP\PhpSpec\CodeCoverage;
use PhpSpec\ObjectBehavior;
use PhpSpec\ServiceContainer\IndexedServiceContainer;
use Prophecy\Argument;
/**
* @author Henrik Bjornskov
*/
class CodeCoverageExtensionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension');
}
function it_should_use_html_format_by_default()
{
$container = new IndexedServiceContainer;
$this->load($container, []);
$options = $container->get('code_coverage.options');
if ($options['format'] !== ['html']) {
throw new Exception("Default format is not html");
}
}
function it_should_transform_format_into_array()
{
$container = new IndexedServiceContainer;
$container->setParam('code_coverage', array('format' => 'html'));
$this->load($container);
$options = $container->get('code_coverage.options');
if ($options['format'] !== ['html']) {
throw new Exception("Default format is not transformed to an array");
}
}
function it_should_use_singular_output()
{
$container = new IndexedServiceContainer;
$container->setParam('code_coverage', array('output' => 'test', 'format' => 'foo'));
$this->load($container);
$options = $container->get('code_coverage.options');
if ($options['output'] !== ['foo' => 'test']) {
throw new Exception("Default format is not singular output");
}
}
}