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

SplFloat   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 26
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test() 0 21 1
A test_unexpected_value_exception_string() 0 9 1
A test_unexpected_value_exception_bool() 0 9 1
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 SplFloat extends atoum
20
{
21
    public function test()
22
    {
23
        $this
24
            ->given($this->newTestedInstance)
25
            ->then
26
                ->float((float) (string) $this->testedInstance)
27
                    ->isEqualTo(0.0)
28
        ;
29
30
        $this
31
            ->given($this->newTestedInstance(10.1))
32
            ->then
33
                ->float((float) (string) $this->testedInstance)
34
                    ->isEqualTo(10.1)
35
        ;
36
37
        $this
38
            ->given($this->newTestedInstance('10.1', false))
39
            ->then
40
                ->float((float) (string) $this->testedInstance)
41
                    ->isEqualTo(10.1)
42
        ;
43
    }
44
45
    public function test_unexpected_value_exception_bool()
46
    {
47
        $this
48
            ->exception(
49
                function() {
50
                    $this->newTestedInstance(false);
51
                }
52
            )
53
            ->isInstanceOf('\UnexpectedValueException')
54
        ;
55
    }
56
57
    public function test_unexpected_value_exception_string()
58
    {
59
        $this
60
            ->exception(
61
                function() {
62
                    $this->newTestedInstance('10');
63
                }
64
            )
65
            ->isInstanceOf('\UnexpectedValueException')
66
        ;
67
    }
68
}
69