Example #1
0
 function testDelete()
 {
     $expected = "MyStringToDelete";
     $this->object->set('testDelete', $expected);
     $this->assertEquals($expected, $this->object->get('testDelete'));
     $this->object->delete('testDelete');
     $this->assertFalse($this->object->get('testDelete'));
 }
 public function testRetrieveFromCache()
 {
     $cache = new APCCache();
     $cache->flush();
     $car = CachedCar::Find(3, 'FlexibleORMTests\\Mock\\CachedOwner');
     $retrievedCar = CachedCar::RetrieveFromCache(3, 'FlexibleORMTests\\Mock\\CachedOwner');
     //        $apc = new \APCIterator('user');
     //        echo "\nCached:\n";
     //        foreach ( $apc as $cached ) {
     //            var_dump($cached);
     //        }
     $this->assertEquals($car, $retrievedCar);
 }
Example #3
0
 * PHPUnit tests for flexible-orm
 */
namespace FlexibleORMTests;

use ORM\AutoLoader;
use ORM\Utilities\Cache\APCCache;
use ORM\Utilities\Configuration;
use PHPUnit_Framework_TestCase;
error_reporting(E_ALL);
require_once __DIR__ . '/../src/AutoLoader.php';
require_once 'AWSSDKforPHP/sdk.class.php';
$loader = new AutoLoader();
$loader->register(AutoLoader::AUTOLOAD_STYLE_FORM);
$loader->setPackageLocations(array('FlexibleORMTests' => __DIR__));
Configuration::Load(__DIR__ . '/test.ini');
Configuration::SetCacheClass('\\ORM\\Utilities\\Cache\\APCCache');
if (function_exists('apc_clear_cache')) {
    $cache = new APCCache();
    $cache->flush();
}
/**
 * Description of ORMTestClass
 *
 */
class ORMTest extends PHPUnit_Framework_TestCase
{
    public function testTruth()
    {
        $this->assertTrue(1 == 1);
    }
}