Exemple #1
0
 /**
  * Test __callStatic
  *
  * @author Tom Haskins-Vaughan <*****@*****.**>
  * @since  0.3.0
  */
 public function testCallStatic()
 {
     $weight = Weight::LB(10, 20);
     $this->assertSame('LB', $weight->getUom()->getName());
     $this->assertSame('1/2', (string) $weight->getAmount());
     $newWeight = $weight->to(Uom::OZ());
     $this->assertSame('8', (string) $newWeight->getAmount());
 }
Exemple #2
0
 /**
  * isSameValueAsProvider
  *
  * @author Tom Haskins-Vaughan <*****@*****.**>
  * @since  0.10.0
  *
  * @return array
  */
 public static function isSameValueAsProvider()
 {
     $oz = Uom::OZ();
     return [[$oz, $oz, true], [Uom::OZ(), Uom::OZ(), true], [Uom::LB(), Uom::LB(), true], [Uom::KG(), Uom::KG(), true], [Uom::LB(), Uom::KG(), false], [Uom::OZ(), Uom::LB(), false]];
 }