PHP Classes

File: tests/Fakerino/Test/Configuration/ConfigurationFile/Helper/FileConfigurationLoaderFactoryTest.php

Recommend this page to a friend!
  Classes of Nicola Pietroluongo   Fakerino   tests/Fakerino/Test/Configuration/ConfigurationFile/Helper/FileConfigurationLoaderFactoryTest.php   Download  
File: tests/Fakerino/Test/Configuration/ConfigurationFile/Helper/FileConfigurationLoaderFactoryTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Fakerino
Generate fake names and other types of fake data
Author: By
Last change: Merge branch 'di-fix' into 0.8.1
Date: 8 years ago
Size: 1,468 bytes
 

Contents

Class file image Download
<?php
/**
 * This file is part of the Fakerino package.
 *
 * (c) Nicola Pietroluongo <nik.longstone@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Fakerino\Test\Configuration\ConfigurationFile\Helper;

use
Fakerino\Configuration\ConfigurationFile\Helper\FileConfigurationLoaderFactory;

class
FileConfigurationLoaderFactoryTest extends \PHPUnit_Framework_TestCase
{
    public function
setUp()
    {
       
$this->fileDir = __DIR__ . '/../../../Fixtures/';
       
$this->ini = $this->fileDir . 'file.ini';
       
$this->notSupportedFile = $this->fileDir . 'file.xyz';
    }

    public function
testCreateConfFile()
    {
       
$conf = new FileConfigurationLoaderFactory($this->ini, array('ini'));

       
$this->assertInstanceOf('Fakerino\Configuration\ConfigurationFile\IniConfigurationFile', $conf->load());
    }

    public function
testFileNotFound()
    {
       
$this->setExpectedException('Fakerino\DataSource\File\Exception\FileNotFoundException');

       
$conf = new FileConfigurationLoaderFactory($this->fileDir . '.foo', array('ini'));
       
$conf->load();
    }

    public function
testConfNotSupported()
    {
       
$this->setExpectedException('Fakerino\Configuration\Exception\ConfNotSupportedException');

       
$conf = new FileConfigurationLoaderFactory($this->notSupportedFile, array('ini'));
       
$conf->load();
    }
}