EuclideanDistanceTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A itCalculatesEuclideanDistance() 0 14 1
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