Exemplo n.º 1
0
 /**
  * @depends testCreateSuccess
  */
 public function testImportSuccess()
 {
     $dumpFullPath = self::$manager->getDumpsDirectoryPath(self::FIXTURE_MODULE) . DIRECTORY_SEPARATOR . self::DUMP_FILE_NAME;
     if (is_file($dumpFullPath)) {
         self::$manager->import(self::DUMP_FILE_NAME, self::FIXTURE_MODULE);
         $result = self::$db->query("SHOW TABLES LIKE '" . self::TABLE_NAME . "';", Adapter::QUERY_MODE_EXECUTE);
         $this->assertEquals(1, $result->count());
         unlink($dumpFullPath);
         $db = new Mysql(self::$db);
         $db->dropTable(self::TABLE_NAME);
     } else {
         $this->fail('Dump file not exist!');
     }
 }
Exemplo n.º 2
0
 /**
  * @depends testCreateDumpSuccess
  */
 public function testListDumpSuccess()
 {
     $dumpFullPath = self::$manager->getDumpsDirectoryPath() . DIRECTORY_SEPARATOR . self::DUMP_FILE_NAME;
     if (is_file($dumpFullPath)) {
         // dispatch url
         $this->dispatch('ls dump -i');
         $this->assertResponseStatusCode(0);
         $this->assertActionName('list');
         $this->assertControllerName('ZFCTool\\Controller\\Dump');
         $this->assertControllerClass('DumpController');
         $this->assertMatchedRouteName('listing-dump');
         unlink($dumpFullPath);
     } else {
         $this->fail('Dump file not exist!');
     }
 }