public function test_setAll_CorrectlyConvertsItemsToString_BeforePersistingToOption() { $newList = array('1', Date::factory('2015-02-03'), 4.5); $this->distributedList->setAll($newList); $optionValue = $this->getOptionValueForList(); $expectedOptionList = array('1', '2015-02-03', '4.5'); $this->assertEquals(serialize($expectedOptionList), $optionValue); $list = $this->distributedList->getAll(); $this->assertEquals($expectedOptionList, $list); }
/** * @inheritdoc */ public function setAll($items) { $items = array_unique($items, SORT_REGULAR); $items = array_values($items); parent::setAll($items); }
/** * @inheritdoc */ public function setAll($yearMonths) { $yearMonths = array_unique($yearMonths, SORT_REGULAR); parent::setAll($yearMonths); }