Skip to content

Commit

Permalink
Add a test to the shell ProgressHelper float pad fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HavokInspiration committed Oct 17, 2015
1 parent 1cac534 commit 234f643
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/TestCase/Shell/Helper/ProgressHelperTest.php
Expand Up @@ -191,4 +191,53 @@ public function testIncrementWithOptions()

$this->assertEquals($expected, $this->stub->messages());
}

/**
* Test increment and draw with value that makes the pad
* be a float
*
* @return void
*/
public function testIncrementFloatPad()
{
$this->helper->init([
'total' => 50
]);
$expected = [
'',
'=========> 14%',
'',
'====================> 28%',
'',
'==============================> 42%',
'',
'=========================================> 56%',
'',
'===================================================> 70%',
'',
'========================================================> 76%',
'',
'==============================================================> 84%',
'',
'==========================================================================> 100%',
];
$this->helper->increment(7);
$this->helper->draw();
$this->helper->increment(7);
$this->helper->draw();
$this->helper->increment(7);
$this->helper->draw();
$this->helper->increment(7);
$this->helper->draw();
$this->helper->increment(7);
$this->helper->draw();
$this->helper->increment(3);
$this->helper->draw();
$this->helper->increment(4);
$this->helper->draw();
$this->helper->increment(8);
$this->helper->draw();

$this->assertEquals($expected, $this->stub->messages());
}
}

0 comments on commit 234f643

Please sign in to comment.