function import($stringData)
 {
     $file = TEMP_PATH . '/mappings.csv';
     file_put_contents($file, $stringData);
     $importer = new VF_Import_ProductFitments_CSV_Import_TestSubClass($file);
     $importer->import();
 }
Ejemplo n.º 2
0
 function testNotes()
 {
     $importer = new VF_Import_ProductFitments_CSV_Import_TestSubClass($this->csvFile);
     $importer->import();
     $data = $this->exportProductFitments();
     $string = explode("\n", $data);
     $this->assertEquals("sku,universal,make,model,year,notes", $string[0]);
     $this->assertEquals("sku,0,honda,civic,2000,\"code1,code2\"", $string[1]);
 }
    protected function doSetUp()
    {
        $this->switchSchema('make,model,year');
        $this->csvData = 'sku, make, model, year, universal
sku123,  ,  ,  ,1';
        $this->csvFile = TEMP_PATH . '/mappings-single.csv';
        file_put_contents($this->csvFile, $this->csvData);
        $this->insertProduct('sku123');
        $this->insertProduct('sku456');
        $importer = new VF_Import_ProductFitments_CSV_Import_TestSubClass($this->csvFile);
        $importer->import();
    }