/** * Validator: splits array => splits string * @param string $key * @param array $options * @return boolean */ protected static function validateSplits($key, $options) { if (!isset($_POST[$key])) { $_POST[$key] = array(); } $Splits = new Splits($_POST[$key]); $_POST[$key] = $Splits->asString(); return true; }
/** * @covers Splits::fillDistancesFromArray */ public function testFillDistancesFromArray() { $Splits = new Splits('0|4:00-0|3:55-0|4:05'); $Splits->fillDistancesFromArray(array(115, 240, 440, 475, 720), array(0.5, 1, 1.9, 2.1, 2.7)); $this->assertEquals('1.00|4:00-1.10|3:55-0.60|4:05', $Splits->asString()); }