public function testTypes() { $types = $this->_model->types(4); $this->assertNotEmpty($types); $this->assertInternalType('array', $types); $type = current($types); $this->assertArrayHasKey('code', $type); $this->assertArrayHasKey('scope', $type); }
/** * Prepare data to create or update image * * @param stdClass $data * @return array */ protected function _prepareImageData($data) { if (!is_object($data)) { return parent::_prepareImageData($data); } $_imageData = get_object_vars($data); if (isset($data->file) && is_object($data->file)) { $_imageData['file'] = get_object_vars($data->file); } return parent::_prepareImageData($_imageData); }