|
| 1 | +<?php |
| 2 | +namespace PhpUnitConversionTest\Unit; |
| 3 | + |
| 4 | +use PHPUnit\Framework\TestCase; |
| 5 | +use PhpUnitConversion\Unit\Velocity; |
| 6 | +use PhpUnitConversion\Unit\Volume; |
| 7 | + |
| 8 | +class VelocityTest extends TestCase |
| 9 | +{ |
| 10 | + public function testFromFootPerHour() |
| 11 | + { |
| 12 | + $volumeUnit = new Velocity\FootPerHour(100000); |
| 13 | + $this->assertEquals('8.467 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(3)); |
| 14 | + } |
| 15 | + |
| 16 | + public function testFromFootPerMinute() |
| 17 | + { |
| 18 | + $volumeUnit = new Velocity\FootPerMinute(100000); |
| 19 | + $this->assertEquals('508.001 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(3)); |
| 20 | + } |
| 21 | + |
| 22 | + public function testFromFootPerSecond() |
| 23 | + { |
| 24 | + $volumeUnit = new Velocity\FootPerSecond(100000); |
| 25 | + $this->assertEquals('30480 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(0)); |
| 26 | + } |
| 27 | + |
| 28 | + public function testFromMilesPerHour() |
| 29 | + { |
| 30 | + $volumeUnit = new Velocity\MilePerHour(100000); |
| 31 | + $this->assertEquals('44704 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(0)); |
| 32 | + } |
| 33 | + |
| 34 | + public function testFromKiloMetersPerHour() |
| 35 | + { |
| 36 | + $volumeUnit = new Velocity\KiloMeterPerHour(100000); |
| 37 | + $this->assertEquals('27777.78 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(2)); |
| 38 | + } |
| 39 | + |
| 40 | + public function testFromMilesPerSecond() |
| 41 | + { |
| 42 | + $volumeUnit = new Velocity\MilePerSecond(100000); |
| 43 | + $this->assertEquals('160934400.00 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(2)); |
| 44 | + } |
| 45 | + |
| 46 | + public function testFromInchPerHour() |
| 47 | + { |
| 48 | + $volumeUnit = new Velocity\InchPerHour(100000); |
| 49 | + $this->assertEquals('0.706 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(3)); |
| 50 | + } |
| 51 | + |
| 52 | + public function testFromInchPerMinute() |
| 53 | + { |
| 54 | + $volumeUnit = new Velocity\InchPerMinute(100000); |
| 55 | + $this->assertEquals('42.333 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(3)); |
| 56 | + } |
| 57 | + |
| 58 | + public function testFromInchPerSecond() |
| 59 | + { |
| 60 | + $volumeUnit = new Velocity\InchPerSecond(100000); |
| 61 | + $this->assertEquals('2540.00 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(2)); |
| 62 | + } |
| 63 | + |
| 64 | + public function testFromKnot() |
| 65 | + { |
| 66 | + $volumeUnit = new Velocity\Knot(100000); |
| 67 | + $this->assertEquals('51444 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(0)); |
| 68 | + } |
| 69 | + |
| 70 | + public function testFromMilesPerMinute() |
| 71 | + { |
| 72 | + $volumeUnit = new Velocity\MilePerMinute(100000); |
| 73 | + $this->assertEquals('2682240.00 m/s', Velocity\MeterPerSecond::from($volumeUnit)->format(2)); |
| 74 | + } |
| 75 | +} |
0 commit comments