protected function setUp() { $this->setupXmlObjects(); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); $this->bfObjectFiller = new BfObjectFiller($this->bfObject, $this->validators, $this->logger); TestsHelpers::cleanAllLogs(); }
protected function setUp() { $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); $this->bfManufacturerValidator = new BfManufacturerValidator($this->logger); $iniParams = TestsHelpers::getIniParams(); $this->bfManufacturer = BfObjectFactory::getInstance("BfManufacturer", $iniParams->get("bfVersion")); TestsHelpers::cleanAllLogs(); }
protected function setUp() { $this->db = TestsHelpers::getDb(); $this->db->setVerboseMode(); $this->systemLogger = LoggerFactory::getFileLogger(TestsHelpers::getSystemLog(), Logger::INFO); TestsHelpers::cleanAllLogs(); $this->cleanTestRows(); }
public function testCleanAllLogs() { $logFile = TestsHelpers::getLogDir() . "/test.log"; file_put_contents($logFile, "fake content"); $this->assertFileExists($logFile); TestsHelpers::cleanAllLogs(); $this->assertFileNotExists($logFile); }
protected function setUp() { TestsHelpers::cleanAllLogs(); $this->iniParams = TestsHelpers::getIniParams(); $this->idPrefix = $this->iniParams->get("idPrefix"); $this->bfVersion = $this->iniParams->get("bfVersion"); $this->taxCategory = $this->iniParams->get("taxCategory"); $this->viewAllowCategory = $this->iniParams->get("viewAllowCategory"); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); $this->xmlItemMapper = new ProductMapper($this->idPrefix, $this->bfVersion, $this->taxCategory, $this->viewAllowCategory, $this->logger); }
protected function setUp() { TestsHelpers::cleanAllLogs(); $iniParams = TestsHelpers::getIniParams(); $this->idPrefix = $iniParams->get("idPrefix"); $this->bfVersion = $iniParams->get("bfVersion"); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); $this->xmlItemMapper = new CategoryMapper($this->idPrefix, $this->bfVersion, $this->logger); $this->db = TestsHelpers::getDb(); $this->okChannel = new OkChannel($iniParams->get("channelId"), $this->db); }
protected function setUp() { TestsHelpers::cleanAllLogs(); $this->localFeedPath = E7_PATH . "/tests/E7/ConnectorsSets/Data/localFeeds/products/file1.xml"; $this->localFeedDir = dirname($this->localFeedPath); $this->remoteFeedDir = E7_PATH . "/tests/E7/ConnectorsSets/Data/remoteFeeds/products"; $this->xmlExporter = m::mock('E7\\ConnectorsSets\\XmlExporter')->shouldReceive(array("generateXml" => true))->mock(); $this->ftp = TestsHelpers::getFtpConnection(); $this->logFile = TestsHelpers::getUserLog(); $this->logger = LoggerFactory::getFileLogger($this->logFile, Logger::INFO); $this->testFiles = array("products_20130101_123000.xml", "products_20140101_123000.xml", "products_20150101_123000.xml"); }
protected function tearDown() { TestsHelpers::cleanAllLogs(); $archiveDir = "processed/" . date("Y/m/d"); foreach ($this->testFiles as $testfile) { $localArchiveFile = $this->localFeedDir . "/" . $archiveDir . "/" . $testfile; $localFile = $this->localFeedDir . "/" . $testfile; if (file_exists($localArchiveFile)) { rename($localArchiveFile, $localFile); } @unlink($localArchiveFile); } TestsHelpers::delTreeUntil($this->localFeedDir . "/" . $archiveDir, "processed"); }
protected function setUp() { TestsHelpers::cleanAllLogs(); $iniParams = TestsHelpers::getIniParams(); $this->idPrefix = $iniParams->get("idPrefix"); $this->bfVersion = $iniParams->get("bfVersion"); $this->orderShipCarrier = $iniParams->get("orderShipCarrier"); $this->orderShipMethod = $iniParams->get("orderShipMethod"); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); $this->xmlItemMapper = new OrderStatusMapper($this->bfVersion, $this->orderShipCarrier, $this->orderShipMethod, $this->logger); $this->db = TestsHelpers::getDb(); $this->okChannel = new OkChannel($iniParams->get("channelId"), $this->db); // we have to set the shipping date so the feed returns results $sql = "UPDATE shipping_orders SET shipping_date = NOW()"; $this->db->execute($sql, array()); }
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(); $csvFile = new CsvFile(__DIR__ . "/Data/okProducts.csv", "\t"); $this->okProductsUpdatesArray = $csvFile->getAll(); array_splice($this->okProductsUpdatesArray, 10); $this->xmlExporter = new ProductsUpdates($this->iniParams, $this->okProductsUpdatesArray, $this->logger); $this->fileName = __DIR__ . "/Data/Exports/ProductsUpdates.xml"; if (file_exists($this->fileName)) { unlink($this->fileName); } }
protected function setUp() { $this->db = TestsHelpers::getDb(); $this->db->setVerboseMode(); $this->iniParams = TestsHelpers::getIniParams(); $this->bfVersion = $this->iniParams->get("bfVersion"); $this->okChannel = new OkChannel($this->iniParams->get("channelId"), $this->db); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); TestsHelpers::cleanAllLogs(); $okOrdersStatusesDataProvider = new OkOrdersStatusDataProvider($this->db, $this->okChannel->getCustomersId()); $this->okOrdersStatusesArray = $okOrdersStatusesDataProvider->getAll(); $this->xmlExporter = new OrdersStatuses($this->iniParams, $this->okOrdersStatusesArray, $this->logger); $this->fileName = __DIR__ . "/Data/Exports/OrdersStatuses.xml"; if (file_exists($this->fileName)) { unlink($this->fileName); } // we have to set the shipping date so the feed returns results $sql = "UPDATE shipping_orders SET shipping_date = NOW()"; $this->db->execute($sql, array()); }
protected function tearDown() { TestsHelpers::cleanAllLogs(); }
public function setup() { $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); TestsHelpers::cleanAllLogs(); }
protected function setUp() { $systemLog = TestsHelpers::getSystemLog(); $this->systemLogger = LoggerFactory::getFileLogger($systemLog, Logger::INFO); TestsHelpers::cleanAllLogs(); }