FileHandlerFactoryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsDetectingBadHandler() 0 4 1
A testIsCreatingFileHandler() 0 5 1
1
<?php
2
3
namespace Incenteev\ParameterHandler\Tests;
4
5
use Incenteev\ParameterHandler\FileHandlerFactory;
6
7
class FileHandlerFactoryTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @expectedException RuntimeException
11
     * @expectedExceptionMessage Unsupported file type: foobar
12
     */
13
    public function testIsDetectingBadHandler()
14
    {
15
        FileHandlerFactory::createFileHandler('foobar');
16
    }
17
18
    public function testIsCreatingFileHandler()
19
    {
20
        $handler = FileHandlerFactory::createFileHandler('yml');
21
        $this->assertInstanceOf('Incenteev\\ParameterHandler\\FileHandler\\YamlHandler', $handler);
22
    }
23
}
24