<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR .
'GostsnLib.php';
/**
* Tests de la classe GostsnLib
*/
class tests extends PHPUnit_Framework_TestCase
{
/**
* Chemin vers dossier vide
* @var string
*/
private $emptyDir;
/**
* Chemin vers dossier plein
* @var string
*/
private $fullDir;
/**
* Fichier qui sera créé dans le dossier plein
* @var string
*/
private $file;
public function __construct()
{
parent::__construct();
$path =
dirname(__FILE__) . DIRECTORY_SEPARATOR;
$this->emptyDir = $path . 'empty';
$this->fullDir = $path . 'full';
$this->file = $this->fullDir . DIRECTORY_SEPARATOR . 'file';
}
public function setUp()
{
}
public function tearDown()
{
}
/**
* Dossier vide, retourne true
*/
public function testEmptyDir()
{
$result = GostsnLib::isDirEmpty($this->emptyDir);
$this->assertTrue($result);
}
/**
* Dossier plein, retourne false
*/
public function testFullDir()
{
$result = GostsnLib::isDirEmpty($this->fullDir);
$this->assertFalse($result);
}
}