Exemplo n.º 1
0
 /**
  * Verify test create database works.
  */
 public function testCreateSourceContainer()
 {
     if (!empty(xPDOTestHarness::$debug)) {
         print "\n" . __METHOD__ . " = ";
     }
     $xpdo = xPDOTestHarness::getInstance(true);
     $created = $xpdo->getManager()->createSourceContainer();
     $this->assertTrue($created == true, "Could not create database.");
 }
Exemplo n.º 2
0
 public static function tearDownAfterClass()
 {
     $xpdo = xPDOTestHarness::getInstance();
     $paths = array(xPDOTestHarness::$properties['xpdo_test_path'] . "fs/zip/");
     foreach ($paths as $path) {
         $xpdo->getCacheManager()->deleteTree($path, array('deleteTop' => true, 'skipDirs' => false, 'extensions' => array()));
     }
     $files = array(xPDOTestHarness::$properties['xpdo_test_path'] . "fs/test-1.zip", xPDOTestHarness::$properties['xpdo_test_path'] . "fs/test-2.zip", xPDOTestHarness::$properties['xpdo_test_path'] . "fs/test-3.zip");
     foreach ($files as $file) {
         if (is_file($file)) {
             unlink($file);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Verify drop database works.
  */
 public function testRemoveSourceContainer()
 {
     if (!empty(xPDOTestHarness::$debug)) {
         print "\n" . __METHOD__ . " = ";
     }
     $xpdo = xPDOTestHarness::getInstance(true);
     $success = false;
     if ($xpdo) {
         $driver = xPDOTestHarness::$properties['xpdo_driver'];
         $dsn = xPDOTestHarness::$properties[$driver . '_string_dsn_test'];
         $dsn = xPDO::parseDSN($dsn);
         $success = $xpdo->getManager()->removeSourceContainer($dsn);
     }
     $this->assertTrue($success, "Test container exists and could not be removed for initialization via xPDOManager->removeSourceContainer()");
 }
Exemplo n.º 4
0
 protected function setUp()
 {
     $this->xpdo = xPDOTestHarness::getInstance();
 }