Passage en Namespace et tous les tests fonctionnels OK

This commit is contained in:
2021-05-10 11:48:15 +02:00
parent 536dd0d56b
commit eb30d8ef97
56 changed files with 1091 additions and 964 deletions

View File

@@ -7,8 +7,10 @@
namespace Domframework\Tests;
/** Test the cache.php file */
class cachefileTest extends \PHPUnit_Framework_TestCase
use Domframework\Cachefile;
/** Test the Cachefile.php file */
class CachefileTest extends \PHPUnit_Framework_TestCase
{
public function testInit ()
{
@@ -19,7 +21,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// Unknown cache file : return FALSE
public function testRead1 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->read ("id");
$this->assertFalse ($res);
@@ -28,7 +30,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// Write in cache file
public function testWrite1 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->write ("id","DATA_TO_STORE", 3);
$this->assertTrue ($res);
@@ -37,7 +39,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// Previous cache file : return DATA_TO_STORE
public function testRead2 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->read ("id");
$this->assertSame ("DATA_TO_STORE", $res);
@@ -52,7 +54,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// Previous cache file but expired : return false
public function testRead3 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->read ("id");
$this->assertFalse ($res);
@@ -61,7 +63,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// Write in cache file
public function testWrite2 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->write ("id","DATA_TO_STORE", 30);
$this->assertTrue ($res);
@@ -77,7 +79,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
// This test takes 10s to wait the lock which will never be released
public function testRead4 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->read ("id");
$this->assertSame ("DATA_TO_STORE", $res);
@@ -85,7 +87,7 @@ class cachefileTest extends \PHPUnit_Framework_TestCase
public function testDel1 ()
{
$c = new cachefile ();
$c = new Cachefile ();
$c->directory = "/tmp/cache";
$res = $c->delete ("id");
}