public static function convertTo($time, $unit, $destUnit) { self::validateUnit($unit); self::validateUnit($destUnit); $destM = self::$map[$destUnit]; $sourceM = self::$map[$unit]; $time = $time * $sourceM / $destM; return $time; }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage Expected string value */ public function testInvalidUnitType() { TimeUnit::convertTo(100, new \stdClass(), TimeUnit::MINUTES); }