private function getOkManufacturers($limit = 50) { $okManufacturersDataProvider = new OkManufacturersDataProvider($this->db, $this->okChannel->getLanguageId()); $okManufacturersArray = $okManufacturersDataProvider->getAll(); array_splice($okManufacturersArray, $limit); return $okManufacturersArray; }
protected function setUp() { $this->db = TestsHelpers::getDb(); //$this->db->setVerboseMode(); $this->iniParams = TestsHelpers::getIniParams(); $this->idPrefix = $this->iniParams->get("idPrefix"); $this->okChannel = new OkChannel($this->iniParams->get("channelId"), $this->db); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); TestsHelpers::cleanAllLogs(); // Build short sets of test data $csvFile = new CsvFile(__DIR__ . "/Data/okProducts.csv", "\t"); $this->okProductsArray = $csvFile->getAll(); array_splice($this->okProductsArray, 10); $okManufacturersDataProvider = new OkManufacturersDataProvider($this->db, $this->okChannel->getLanguageId()); $this->okManufacturersArray = $okManufacturersDataProvider->getAll(); array_splice($this->okManufacturersArray, 10); $this->xmlExporter = new Products($this->iniParams, $this->okProductsArray, $this->okManufacturersArray, $this->logger); $this->fileName = __DIR__ . "/Data/Exports/Products.xml"; if (file_exists($this->fileName)) { unlink($this->fileName); } }