public function testRemoveOrphan_RemovesProductWithoutManufacturer() { $this->okProductsArray[2]->products_manufacturers_id = "UNKNOWN"; $productsFilter = new OkProductsFilter($this->okManufacturersArray, $this->logger); $productsWithoutOrphans = $productsFilter->removeOrphans($this->okProductsArray); $this->assertEquals(count($this->okProductsArray) - 1, count($productsWithoutOrphans)); TestsHelpers::testUserLogContains("Product <PROD3> has unresolved Manufacturer <UNKNOWN> dependency"); TestsHelpers::testUserLogContains("Removing product <PROD3> : <stdClass Object( [sku] => PROD3 [products_manufacturers_id] => UNKNOWN)>"); }
private function removeOrphansProducts($okProductsUnfiltered) { $productsFilter = new OkProductsFilter($this->okManufacturersArray, $this->logger); return $productsFilter->removeOrphans($okProductsUnfiltered); }