PHP Classes

File: tests/Fakerino/Test/DataSource/File/Exception/FileExceptionsTest.php

Recommend this page to a friend!
  Classes of Nicola Pietroluongo   Fakerino   tests/Fakerino/Test/DataSource/File/Exception/FileExceptionsTest.php   Download  
File: tests/Fakerino/Test/DataSource/File/Exception/FileExceptionsTest.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:
Date: 8 years ago
Size: 1,257 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\File\Exception;

use
Fakerino\DataSource\File\Exception\FileEmptyException;
use
Fakerino\DataSource\File\Exception\FileLineNotFoundException;
use
Fakerino\DataSource\File\Exception\FileNotFoundException;

class
FileExceptionsTest extends \PHPUnit_Framework_TestCase
{
    public function
testFileEmptyException()
    {
       
$e = new FileEmptyException('file.txt');

       
$this->assertEquals('The file "file.txt" is empty', $e->getMessage(), 'A message should be generated');
    }

    public function
testFileLineNotFoundException()
    {
       
$e = new FileLineNotFoundException(1, 'file.txt');

       
$this->assertEquals('The line "1" does not exist in file "file.txt"', $e->getMessage(), 'A message should be generated');
    }

    public function
testFileNotFoundException()
    {
       
$e = new FileNotFoundException('file.txt');

       
$this->assertEquals('The file "file.txt" does not exist', $e->getMessage(), 'A message should be generated');
    }
}