ClassifierTest::testGetName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Bobbyshaw\WatsonVisualRecognition\Tests;
4
5
use Bobbyshaw\WatsonVisualRecognition\Classifier;
6
use DateTime;
7
8
/**
9
 * Class ClassifierTest
10
 * @package Bobbyshaw\WatsonVisualRecognition\Tests
11
 */
12
class ClassifierTest extends Base
13
{
14
    /** @var Classifier */
15
    private $classifier;
16
17
    private $classifierId = '1';
18
    private $classifierName = 'test';
19
    private $classifierScore = 0.9;
20
    private $classifierOwner = 'IBM';
21
    private $classifierCreated = '2016-03-24T14:19:16.000Z';
22
23
    public function setUp()
24
    {
25
        $this->classifier = new Classifier(
26
            $this->classifierId,
27
            $this->classifierName,
28
            $this->classifierScore,
29
            $this->classifierOwner,
30
            new DateTime($this->classifierCreated)
31
        );
32
    }
33
34
    public function testGetId()
35
    {
36
        $this->assertEquals($this->classifierId, $this->classifier->getId());
37
    }
38
39
    public function testGetName()
40
    {
41
        $this->assertEquals($this->classifierName, $this->classifier->getName());
42
    }
43
44
    public function testGetScore()
45
    {
46
        $this->assertEquals($this->classifierScore, $this->classifier->getScore());
47
    }
48
49
    public function testGetOwner()
50
    {
51
        $this->assertEquals($this->classifierOwner, $this->classifier->getOwner());
52
    }
53
54
    public function testGetCreated()
55
    {
56
        $this->assertEquals(new DateTime($this->classifierCreated), $this->classifier->getCreated());
57
    }
58
}
59