Exemplo n.º 1
0
 public function testGetCommandList()
 {
     $app = __setupApp();
     $console = new Console($app, true);
     $console->addCommands(array('\\Skully\\Tests\\Commands\\NewCommand'));
     $list = $console->getCommands();
     $listString = array();
     foreach ($list as $item) {
         $listString[] = get_class($item);
     }
     $this->assertTrue(in_array('Skully\\Commands\\EncryptCommand', $listString));
     $this->assertTrue(in_array('Skully\\Commands\\DecryptCommand', $listString));
     $this->assertTrue(in_array('Skully\\Commands\\SchemaCommand', $listString));
     $this->assertTrue(in_array('Skully\\Commands\\PackCommand', $listString));
     $this->assertTrue(in_array('Skully\\Tests\\Commands\\NewCommand', $listString));
 }
 public function testSetupGit()
 {
     $app = __setupApp();
     $console = new Console($app, true);
     $console->addCommands($app->config('additionalCommands'));
     $gitpath = realpath(__DIR__ . '/../app/.git-s3');
     echo $gitpath;
     shell_exec('rm -rf ' . $gitpath);
     $this->assertFalse(file_exists($gitpath));
     $commands = $console->getCommands();
     function className($item)
     {
         return get_class($item);
     }
     print_r(array_map('className', $commands));
     $output = $console->run("skully:s3 setup:git -f");
     echo $output->fetch();
     FileHelper::removeFolder($gitpath);
     $this->assertFalse(file_exists($gitpath));
 }