From 96fc105ee740be3c00f8050c07d5ab55b433809d Mon Sep 17 00:00:00 2001 From: Ben Griffith Date: Mon, 2 Oct 2023 23:03:21 -0500 Subject: [PATCH 1/2] Start of Boil Rate --- src/Rate/Boil.php | 8 ++++++++ tests/Rate/BoilRate.php | 17 +++++++++++++++++ tests/Rate/FlowTest.php | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/Rate/Boil.php create mode 100644 tests/Rate/BoilRate.php diff --git a/src/Rate/Boil.php b/src/Rate/Boil.php new file mode 100644 index 0000000..4fac62d --- /dev/null +++ b/src/Rate/Boil.php @@ -0,0 +1,8 @@ +assertEquals(new Volume(gallon: 3), $boil->getGallonsPerMinute()); + } +} \ No newline at end of file diff --git a/tests/Rate/FlowTest.php b/tests/Rate/FlowTest.php index 724fdae..4368421 100644 --- a/tests/Rate/FlowTest.php +++ b/tests/Rate/FlowTest.php @@ -58,10 +58,10 @@ public function testVolumeWithInvalidNumeratorUnitTypeThrowsRuntimeException(): public function testVolumeWithInvalidDenominatorUnitTypeThrowsRuntimeException(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Method getBannana does not exist on Unitz\Time'); + $this->expectExceptionMessage('Method getBanana does not exist on Unitz\Time'); $flow = new Flow(new Volume(gallon: 3), new Time(minute: 1)); - $flow->getGallonsPerBannanas(); + $flow->getGallonsPerBananas(); } public function testFlowReturnsCorrectValue(): void From 5e254ccda65bed312260d4319c0110025a16349a Mon Sep 17 00:00:00 2001 From: Ben Griffith Date: Mon, 2 Oct 2023 23:12:09 -0500 Subject: [PATCH 2/2] Boil Documentation --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e61d71..c2b4585 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ pattern of `$rate->get{Unit}Per{Unit}` for the respective units. Example using F ### Flow -This class represent the amount of Volume over a period of Time. +This class represent the amount of Volume flowed over a period of Time. ```php $flow = new Flow(new Volume(gallon: 5), new Time(hour: 1)); @@ -165,6 +165,20 @@ $flow->getGallonPerMinute(); // 0.083333333333333 ___ +### Boil + +This class represent the amount of Volume boiled over a period of Time. + +```php +$boil = new Boil(new Volume(gallon: 5), new Time(hour: 1)); + +$boil->getGallonPerHour(); // 5 + +$boil->getGallonPerMinute(); // 0.083333333333333 +``` + +___ + ## Calculate A library of calculations that can be used with various Unitz classes.