Example #1
0
 public function testImportFail()
 {
     try {
         self::$manager->import('', null);
     } catch (DumpNotFound $expected) {
         $this->assertTrue(true);
         return;
     }
     $this->fail("No exception!");
 }
Example #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!');
     }
 }
Example #3
0
 /**
  * list dump files
  */
 public function listAction()
 {
     $module = $this->request->getParam('module');
     if ($module) {
         $this->console->writeLine('Only for module "' . $module . '":');
     }
     $includeModules = $this->request->getParam('includemodules');
     try {
         $dumps = $this->manager->getExistsDumps($module, $includeModules);
         if ($dumps) {
             //Display legend
             $this->console->writeLine("|dump\t\t\t|module", Color::GRAY);
         }
         foreach ($dumps as $module => $dump) {
             foreach ($dump as $file) {
                 $this->console->writeLine("{$file}\t{$module}", Color::GREEN, null);
             }
         }
     } catch (ZFCToolException $e) {
         $this->console->writeLine($e->getMessage(), Color::RED);
     } catch (\Exception $e) {
         $this->console->writeLine($e->getMessage(), Color::RED);
     }
 }