itCalculatesEuclideanDistance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace Undemanding\Difference\Test\Method;
4
5
use Undemanding\Difference\Method\EuclideanDistance;
6
use Undemanding\Difference\Test\Test;
7
8
class EuclideanDistanceTest extends Test
9
{
10
    /**
11
     * @test
12
     */
13
    public function itCalculatesEuclideanDistance()
14
    {
15
        $method = new EuclideanDistance();
16
17
        $this->assertEquals(43.3, round($method(
18
            ["r" => 100, "g" => 125, "b" => 150],
19
            ["r" => 125, "g" => 150, "b" => 175]
20
        ), 1));
21
22
        $this->assertEquals(29.58, round($method(
23
            ["r" => 205, "g" => 210, "b" => 215],
24
            ["r" => 200, "g" => 195, "b" => 190]
25
        ), 2));
26
    }
27
}
28