PHP Classes

File: tests/Fakerino/Test/DataSource/FakeFileContainerTest.php

Recommend this page to a friend!
  Classes of Nicola Pietroluongo  >  Fakerino  >  tests/Fakerino/Test/DataSource/FakeFileContainerTest.php  >  Download  
File: tests/Fakerino/Test/DataSource/FakeFileContainerTest.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: * Fix nested fake bug
* Fix yml parser bug
* Add tests
* Refactor classes
Date: 6 years ago
Size: 1,142 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\DataSource;

use
Fakerino\DataSource\FakeFileContainer;
use
Fakerino\DataSource\File\File;

class
FakeFileContainerTest extends \PHPUnit_Framework_TestCase
{
    public function
setUp()
    {
       
$this->filePath = __DIR__ . '/../Fixtures/file.txt';
    }

    public function
testGetNotExistedFile()
    {
       
$container = new FakeFileContainer();

       
$this->assertFalse($container->get('wrongPath/foo.txt'));
    }

    public function
testContainer()
    {
       
$container = new FakeFileContainer();

       
$this->assertInstanceOf('\SplFileInfo', $container->get($this->filePath));
    }

    public function
testAddMethod()
    {
       
$container = new FakeFileContainer();
       
$file = new File($this->filePath);
       
$container->add('file', $file);

       
$this->assertInstanceOf('\SplFileInfo', $container->get($this->filePath));
    }
}

For more information send a message to info at phpclasses dot org.