PHP Classes

File: tests/Fakerino/Test/FakeData/Generator/FileFakeGeneratorTest.php

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

use
Fakerino\FakeData\Core\FileFake;
use
Fakerino\FakeData\Custom\Text;
use
Fakerino\FakeData\Generator\FileFakeGenerator;

class
FileFakeGeneratorTest extends \PHPUnit_Framework_TestCase
{

    public function
setUp()
    {
       
$this->fileFakeGenerator = new FileFakeGenerator();
       
$this->fileFakeGenerator->setCaller(new Text());
    }

    public function
testConstructor()
    {
       
$this->assertInstanceOf('Fakerino\FakeData\FakeDataGeneratorInterface', $this->fileFakeGenerator);
    }

    public function
testReturnNull()
    {
       
$this->assertNull($this->fileFakeGenerator->generate());
    }

    public function
testReturnRandomLine()
    {
       
$fileFakeGenerator = new FileFakeGenerator();
       
$fileFakeGenerator->setCaller(new FileFake(__DIR__ . '/../Fixtures/file.txt'));
       
$generatedString = $fileFakeGenerator->generate();
       
$this->assertNotNull($generatedString);
       
$this->assertInternalType('string', $generatedString);
    }
}