function testCount1() { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig()); $vehicle = $this->createMMTC(); $this->insertMappingMMTC($vehicle); $this->assertEquals(1, $sitemap->vehicleCount()); }
function testDefinitionsMMY() { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig()); $vehicles = $sitemap->getDefinitions(10); $this->assertTrue($vehicles[0] instanceof VF_Vehicle); $this->assertNotEquals(0, (int) $vehicles[0]->getLevel('year')->getId()); }
function doProduct($product) { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(Elite_Vaf_Helper_Data::getInstance()->getConfig()); $vehicles = $sitemap->getDefinitions(null, null, $product->getId()); foreach ($vehicles as $vehicle) { $product->setCurrentlySelectedFit($vehicle); fwrite($this->stream, $this->row($product, $vehicle)); } }
function testDefinitions() { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(Elite_Vaf_Helper_Data::getInstance()->getConfig()); $vehicle = $this->createMMTC(); $this->insertMappingMMTC($vehicle); $vehicles = $sitemap->getDefinitions(); $this->assertTrue($vehicles[0] instanceof VF_Vehicle); $this->assertNotEquals(0, (int) $vehicles[0]->getLevel('chassis')->getId()); }
/** @todo move/rename this to definition finder -> find all in use() method */ function getDefinitions($perPage = false, $offset = false) { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle($this->getConfig()); return $sitemap->getDefinitions($perPage, $offset); }
function testWhenThereIsNotAMappingShouldNotCountTheDefinition() { $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(Elite_Vaf_Helper_Data::getInstance()->getConfig()); $this->assertEquals(0, $sitemap->vehicleCount(), 'when there is not a mapping should not count the definition'); }