PHP Classes

File: tests/FileInfoTest.php

Recommend this page to a friend!
  Classes of Johnny Mast  >  Redbox PHP Scandir Filter  >  tests/FileInfoTest.php  >  Download  
File: tests/FileInfoTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Redbox PHP Scandir Filter
Scan files for new or modified files
Author: By
Last change:
Date: 6 years ago
Size: 854 bytes
 

Contents

Class file image Download
<?php
namespace Redbox\Scan\Tests;
use
Redbox\Scan;

/**
 * This class will run tests against the FileInfo class.
 *
 * @coversDefaultClass Scan\Filesystem\FileInfo
 * @package Redbox\Scan\Tests
 */
class FileInfoTest extends \PHPUnit_Framework_TestCase
{

   
/**
     * Test that FileInfo::getFileHash() returns an empty string on failures.
     */
   
function test_fileinfo_get_hash_should_return_empty()
    {
       
$this->assertEquals(Scan\Filesystem\FileInfo::getFileHash(''), '');
       
$this->assertEquals(Scan\Filesystem\FileInfo::getFileHash('/_i_29kl_don\tExist'), '');
    }

   
/**
     * Test that FileInfo::getFileHash() returns a non empty string (hash) on
     * success.
     */
   
function test_fileinfo_get_hash_should_return_hash()
    {
       
$this->assertNotEmpty(Scan\Filesystem\FileInfo::getFileHash(__FILE__));
    }
}

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