diff --git a/src/TerminalObject/Dynamic/Progress.php b/src/TerminalObject/Dynamic/Progress.php index a860b76..9fa19f6 100644 --- a/src/TerminalObject/Dynamic/Progress.php +++ b/src/TerminalObject/Dynamic/Progress.php @@ -338,4 +338,24 @@ protected function shouldRedraw($percentage, $label) { return ($this->force_redraw || $percentage != $this->current_percentage || $label != $this->label); } + + /** + * Gets de current progress value. + * + * @return integer The current progress value. + */ + public function getCurrent() + { + return $this->current; + } + + /** + * Gets the total value for the progress. + * + * @return integer The total progress value. + */ + public function getTotal() + { + return $this->total; + } } diff --git a/tests/TerminalObject/Dynamic/ProgressTest.php b/tests/TerminalObject/Dynamic/ProgressTest.php index a6e257e..cbebe41 100644 --- a/tests/TerminalObject/Dynamic/ProgressTest.php +++ b/tests/TerminalObject/Dynamic/ProgressTest.php @@ -402,4 +402,14 @@ public function testEach4() return $item; }); } + + public function testGetCurrent() + { + $this->assertEquals(0, $this->cli->progress(100)->getCurrent()); + } + + public function testGetTotal() + { + $this->assertEquals(100, $this->cli->progress(100)->getTotal()); + } }