public function testThatGetLinesReturnsAndArrayOfObjects() { $status = new Status($this->getSvnNumberMock()); $expected = array(); $this->assertCount(2, $status->getLines()); $lines = $status->getLines(); $this->assertInstanceOf('Kafoso\\SvnNumber\\SvnAction\\Status\\Line', $lines[1]); $this->assertInstanceOf('Kafoso\\SvnNumber\\SvnAction\\Status\\Line', $lines[2]); }
throw new \InvalidArgumentException("Command 'svn-number stage #' requires at least one number"); } break; case "stage-all": $status = new Status($svnNumber, $staging); $staging->clear(); foreach ($status->getLines() as $line) { echo "Staged file: " . $line->getFilePath() . PHP_EOL; $staging->addLine($line); } $staging->save(); exit(printStatus($status)); case "unstage": if ($svnNumber->hasRequestedNumbers()) { $status = new Status($svnNumber, $staging); $lines = array_intersect_key($status->getLines(), array_flip($svnNumber->getRequestedNumbers())); foreach ($lines as $line) { echo "Unstaged file: " . $line->getFilePath() . PHP_EOL; $staging->removeLine($line); } $staging->save(); exit(printStatus($status, true)); } else { throw new \InvalidArgumentException("Command 'svn-number unstage #' requires at least one number"); } break; case "unstage-all": $staging->clear()->save(); echo "Unstaged all files." . PHP_EOL; $status = new Status($svnNumber, $staging); exit(printStatus($status));