mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
Lower quality boundary on regular product runs OK.
This commit is contained in:
parent
cd58aa0141
commit
0f34215891
@ -215,7 +215,34 @@ class GildedRoseTest extends \PHPUnit\Framework\TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals(50, $app->getItems()[0]->quality);
|
$this->assertEquals(50, $app->getItems()[0]->quality);
|
||||||
|
$this->assertEquals(50, $app->getItems()[1]->quality);
|
||||||
|
$this->assertEquals(50, $app->getItems()[2]->quality);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test lower quality boundary of a product is prevalent
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testQualityLowerBoundaryOnRegularProduct()
|
||||||
|
{
|
||||||
|
$items = [
|
||||||
|
new Item('Elixir of the Mongoose', 5, 1),
|
||||||
|
new Item('Elixir of the Mongoose', 5, 2),
|
||||||
|
new Item('Elixir of the Mongoose', 5, 3),
|
||||||
|
];
|
||||||
|
|
||||||
|
$interval = 3;
|
||||||
|
$app = new GildedRose($items);
|
||||||
|
|
||||||
|
for ($i = 0; $i < $interval; $i++) {
|
||||||
|
$app->updateQuality();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->assertEquals(0, $app->getItems()[0]->quality);
|
||||||
|
$this->assertEquals(0, $app->getItems()[1]->quality);
|
||||||
|
$this->assertEquals(0, $app->getItems()[2]->quality);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user