diff --git a/src/Measure.php b/src/Measure.php index 18c5cc26..dd414fd6 100644 --- a/src/Measure.php +++ b/src/Measure.php @@ -133,6 +133,8 @@ class Measure const FREQUENCY = 'frequency'; + const FUEL_ECONOMY = 'fuel_economy'; + const LENGTH = "length"; const MASS = "mass"; @@ -190,9 +192,6 @@ class Measure Litre::class, Millilitre::class, Pint::class, - KilometrePerLitre::class, - LitrePer100Kilometres::class, - MilesPerGallon::class, ], self::MASS => [ Gram::class, @@ -279,6 +278,11 @@ class Measure Gigabyte::class, Terabyte::class, ], + self::FUEL_ECONOMY => [ + KilometrePerLitre::class, + LitrePer100Kilometres::class, + MilesPerGallon::class, + ], ]; /** diff --git a/src/Unit/FuelEconomy/FuelEconomyUnit.php b/src/Unit/FuelEconomy/FuelEconomyUnit.php index 83173d2e..3000da28 100644 --- a/src/Unit/FuelEconomy/FuelEconomyUnit.php +++ b/src/Unit/FuelEconomy/FuelEconomyUnit.php @@ -29,5 +29,5 @@ abstract class FuelEconomyUnit extends AbstractUnit { protected $base = KilometrePerLitre::class; - protected $unitOf = Measure::VOLUME; + protected $unitOf = Measure::FUEL_ECONOMY; } diff --git a/tests/unit/Registry/UnitRegistry.spec.php b/tests/unit/Registry/UnitRegistry.spec.php index de9d1642..be8d6acc 100644 --- a/tests/unit/Registry/UnitRegistry.spec.php +++ b/tests/unit/Registry/UnitRegistry.spec.php @@ -83,6 +83,7 @@ public function assertListMeasurementsMethodReturnsArray() "energy", "frequency", "digital_storage", + "fuel_economy", ]; $this->assertEquals($expected, $actual);