ImageTest::testGetClassifier()   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 Bobbyshaw\WatsonVisualRecognition\Image;
7
8
/**
9
 * Class ImageTest
10
 * @package Bobbyshaw\WatsonVisualRecognition\Tests
11
 */
12
class ImageTest extends Base
13
{
14
    /** @var Image */
15
    private $image;
16
17
    /** @var Classifier[] */
18
    private $classifiers;
19
20
    private $imageName = 'parrot';
21
22
23
    public function setUp()
24
    {
25
        $this->classifiers = [new Classifier('test', 'test', 'test')];
26
        $this->image = new Image($this->imageName, $this->classifiers);
27
    }
28
29
    public function testGetName()
30
    {
31
        $this->assertEquals($this->imageName, $this->image->getName());
32
    }
33
34
    public function testGetClassifiers()
35
    {
36
        $this->assertEquals($this->classifiers, $this->image->getClassifiers());
37
    }
38
39
    public function testGetClassifier()
40
    {
41
        $this->assertEquals($this->classifiers[0], $this->image->getClassifier('test'));
42
    }
43
44
    public function testGetClassifierNotFound()
45
    {
46
        $this->assertEquals(false, $this->image->getClassifier('foobar'));
47
    }
48
}
49