public function testFormatName() { $nameMaxLength = TestsHelpers::getXChars(100); $this->assertEquals(TestsHelpers::getXChars(100), BfDataFormatter::formatName($nameMaxLength)); $nameTooLong = TestsHelpers::getXChars(101); $this->assertEquals($nameMaxLength, BfDataFormatter::formatName($nameTooLong)); }
public function testMapWithInvalidDataThrowsException() { $this->setExpectedException("E7\\Helpers\\Exceptions\\XmlItemMapperException", "invalid data <" . TestsHelpers::getXChars(300) . "> for <OrderId> of type <ID>"); $okOrdersStatusesArray = $this->getOkOrdersStatuses(1); $okOrdersStatusesArray[0]->order_id = TestsHelpers::getXChars(300); $bfOrderStatus = $this->xmlItemMapper->map($okOrdersStatusesArray[0]); }
public function testExportWithInvalidData() { $this->okProductsUpdatesArray[0]->sku = TestsHelpers::getXChars(50); $this->xmlExporter = new ProductsUpdates($this->iniParams, $this->okProductsUpdatesArray, $this->logger); $this->xmlExporter->generateXml($this->fileName); $this->assertTrue(TestsHelpers::testUserLogContains("Skipping following product update")); }
public function testExportWithInvalidData() { $this->okOrdersStatusesArray[0]->order_id = TestsHelpers::getXChars(50); $this->xmlExporter = new OrdersStatuses($this->iniParams, $this->okOrdersStatusesArray, $this->logger); $this->xmlExporter->generateXml($this->fileName); $this->assertTrue(TestsHelpers::testUserLogContains("Skipping following order status")); }
public function testMapCategoryWithInvalidDataThrowsException() { $this->setExpectedException("E7\\Helpers\\Exceptions\\XmlItemMapperException", "invalid data <http://images.client.com/images/" . TestsHelpers::getXChars(300) . "> for <PlpImage/Url> of type <VARCHAR_255>"); $okCategoriesArray = $this->getOkCategories(1); $okCategory = $okCategoriesArray[0]; $okCategory->categories_image = TestsHelpers::getXChars(300); $bfCategory = $this->xmlItemMapper->map($okCategory); }
public function testMapManufacturerWithInvalidDataThrowsException() { $this->setExpectedException("E7\\Helpers\\Exceptions\\XmlItemMapperException", "invalid data <ZDE" . TestsHelpers::getXChars(300) . "> for <ManufacturerId> of type <ID>"); $okManufacturersArray = $this->getOkManufacturers(1); $okManufacturer = $okManufacturersArray[0]; $okManufacturer->manufacturers_id = TestsHelpers::getXChars(300); $bfManufacturer = $this->xmlItemMapper->map($okManufacturer); }
public function testMapProductWithInvalidDataThrowsException() { $this->setExpectedException("E7\\Helpers\\Exceptions\\XmlItemMapperException", "invalid data <" . TestsHelpers::getXChars(300) . "> for <InternalName> of type <VARCHAR_255>"); $okProductsArray = $this->getOkProducts(__DIR__ . "/Data/availability-import-data-01.csv"); $okProductsArray[0]->products_products_model = TestsHelpers::getXChars(300); $bfProduct = $this->xmlItemMapper->map($okProductsArray[0]); }
public function putIntoIfValidFail() { return array(array("CategoryId", TestsHelpers::getXChars(21)), array("Varchar60", TestsHelpers::getXChars(61)), array("Varchar100", TestsHelpers::getXChars(101)), array("Varchar255", TestsHelpers::getXChars(256)), array("Indicator", "y"), array("Indicator", "n"), array("Indicator", "a"), array("Indicator", "A"), array("Decimal3", 1.1234), array("Decimal6", 1.1234567), array("Integer", "a"), array("Datetime", "2014-06-31 00:00:00")); }
public function testMapProductUpdateWithInvalidDataThrowsException() { $this->setExpectedException("E7\\Helpers\\Exceptions\\XmlItemMapperException", "invalid data <ZDE" . TestsHelpers::getXChars(30) . "> for <MasterProductId> of type <ID>"); $okProductsUpdatesArray = $this->getOkProductsUpdates(1); $okProductsUpdatesArray[0]->sku = TestsHelpers::getXChars(30); $bfProduct = $this->xmlItemMapper->map($okProductsUpdatesArray[0]); }