public function testRunCmdCaptureMessage() { if (!(substr(php_uname(), 0, 7) == "Windows")) { $this->assertEquals("test\n", USVN_ConsoleUtils::runCmdCaptureMessage("echo test", $return)); $this->assertEquals(0, $return); } }
public function testImportHtpasswd() { file_put_contents('../tests/htpasswd', "noplay:BD3ZmTBhHmWJs\nstem:1YApoa5EK/WFs"); $message = USVN_ConsoleUtils::runCmdCaptureMessage("php tools/usvn-import-htpasswd.php ../tests/test.ini ../tests/htpasswd", $return); $this->assertEquals(0, $return, $message); echo $message; chdir($this->_path); //Else SQLite doesn't work $userTable = new USVN_Db_Table_Users(); $user = $userTable->fetchRow(array('users_login = ?' => "noplay")); $this->assertNotNull($user); $this->assertEquals("BD3ZmTBhHmWJs", $user->password); }
/** * Checkout SVN repository into filesystem * @param string Path to subversion repository * @param string Path to destination */ public static function checkoutSvn($src, $dst) { $dst = escapeshellarg($dst); $src = USVN_SVNUtils::getRepositoryPath($src); $message = USVN_ConsoleUtils::runCmdCaptureMessage(USVN_SVNUtils::svnCommand("co {$src} {$dst}"), $return); if ($return) { throw new USVN_Exception(T_("Can't checkout subversion repository: %s"), $message); } }