function __construct() { parent::__construct(); if (isset($_FILES['file']['error']) && $_FILES['file']['error'] === 0) { $importer = new Elite_Vafpaint_Model_Importer_Definitions_Paint($_FILES['file']['tmp_name']); $importer->import(); $this->messages = 'Import Complete'; } $this->setTemplate('vf/vaf/paintcodes.phtml'); }
function doSetUp() { $this->switchSchema('make,model,year'); $this->csvData = 'make,model,year,Code,Name,Color(hex)' . self::NEWLINE; $this->csvData .= 'Acura, Integra, 1987, B-38, Capitol Blue, #061D72' . self::NEWLINE; $this->csvFile = TEMP_PATH . '/paint-definitions.csv'; file_put_contents($this->csvFile, $this->csvData); $importer = new Elite_Vafpaint_Model_Importer_Definitions_Paint($this->csvFile); $importer->import(); }