Split out and improve tests

This commit is contained in:
Robin Appelman 2014-08-24 02:16:33 +02:00
commit 65b76d6428
3 changed files with 74 additions and 95 deletions

View file

@ -38,23 +38,14 @@ class Connection extends RawConnection {
$output = array();
$line = $this->readLine();
$length = strlen(self::DELIMITER);
while (substr($line, 0, $length) !== self::DELIMITER) { //next prompt functions as delimiter
$length = mb_strlen(self::DELIMITER);
while (mb_substr($line, 0, $length) !== self::DELIMITER) { //next prompt functions as delimiter
$output[] .= $line;
$line = parent::read();
$line = $this->readLine();
}
return $output;
}
/**
* read a single line of unprocessed output
*
* @return string
*/
public function readLine() {
return parent::read();
}
/**
* check if the first line holds a connection failure
*