示例#1
0
 /**
  * @covers ::getPassword
  */
 public function test_getPassword()
 {
     // Given
     _WhatFgets::$fgetsReturn = 'testPass';
     // When
     $gotPass = Interaction::getPassword('Give me password: '******'Give me password: '******'testPass', $gotPass);
 }
示例#2
0
 private function getGitVersion($fileOrDir)
 {
     $newestVersion = '0.0.0';
     $currentDir = getcwd();
     $gitCommand = 'git tag';
     if (!Interaction::commandExist('git')) {
         return $newestVersion;
     }
     if (Str::endsWith($fileOrDir, 'php')) {
         $dir = dirname($fileOrDir);
     } else {
         $dir = $fileOrDir;
     }
     $dir = realpath($dir);
     chdir($dir);
     exec($gitCommand, $output);
     foreach ($output as $version) {
         if (version_compare($newestVersion, $version) === -1) {
             $newestVersion = $version;
         }
     }
     chdir($currentDir);
     return $newestVersion;
 }
示例#3
0
 /**
  * Get database password.
  *
  * Note: Will ask user for password if database password is not provided in config.
  *
  * @return string
  */
 public function askDbPassword()
 {
     return trim(Interaction::getPassword('Enter database password: '));
 }