Exemplo n.º 1
0
 /** @test **/
 public function it_allows_a_string_to_be_used_as_the_conversion_unit()
 {
     $weight = new Weight(1500, new Unit('g'));
     $weight_in_kg = $weight->in('kg');
     $this->assertEquals(1.5, $weight_in_kg->value());
     $this->assertInstanceOf(Weight::class, $weight_in_kg);
     $this->assertInstanceOf(Unit::class, $weight_in_kg->unit());
 }