Test Failed
Push — master ( 39a51a...f867c3 )
by Adrien
01:53
created

SplString::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 21
rs 9.7666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Part of SplTypes package.
5
 *
6
 * (c) Adrien Loyant <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ducks\Component\SplTypes\Tests\atoum;
13
14
use mageekguy\atoum;
0 ignored issues
show
Bug introduced by
The type mageekguy\atoum was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
/**
17
 * @namespace \Tests\atoum
18
 */
19
class SplString extends atoum
20
{
21
    public function test()
22
    {
23
        $this
24
            ->given($this->newTestedInstance)
25
            ->then
26
                ->string((string) $this->testedInstance)
27
                    ->isEqualTo('')
28
        ;
29
30
        $this
31
            ->given($this->newTestedInstance('test'))
32
            ->then
33
                ->string((string) $this->testedInstance)
34
                    ->isEqualTo('test')
35
        ;
36
37
        $this
38
            ->given($this->newTestedInstance(0, false))
39
            ->then
40
                ->string((string) $this->testedInstance)
41
                    ->isEqualTo('0')
42
        ;
43
    }
44
45
    public function test_unexpected_value_exception_int()
46
    {
47
        $this
48
            ->exception(
49
                function() {
50
                    $this->newTestedInstance(0);
51
                }
52
            )
53
            ->isInstanceOf('\UnexpectedValueException')
54
        ;
55
    }
56
57
    public function test_unexpected_value_exception_scalar()
58
    {
59
        $this
60
            ->exception(
61
                function() {
62
                    $this->newTestedInstance(array());
63
                }
64
            )
65
            ->isInstanceOf('\UnexpectedValueException')
66
        ;
67
    }
68
}
69