Completed
Push — develop ( fe8c75...3bcd98 )
by Tom
02:26
created

ClassifierTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
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