function testWhenRewritesDisabled_ShouldNotRewriteTitle() { $config = new Zend_Config(array('seo' => array('rewriteProductName' => false, 'globalRewrites' => true))); $product = $this->getProduct2($config); $product->addVafFit($this->vehicle->toValueArray()); $this->setRequestParams($this->vehicle->toValueArray()); $this->assertEquals('Widget', $product->getName(), 'when rewrites disabled, should not rewrite title'); }
function testWheelSizeShouldNotPrecedeVehicleForNonWheelProducts() { $product = $this->newWheelProduct(1); $product->addVafFit($this->vehicle->toValueArray()); $this->setRequestParams(array('lug_count' => '4', 'stud_spread' => '114.3')); $_SESSION = $this->vehicle->toValueArray(); return $this->markTestIncomplete(); //$this->assertEquals( array(1), $this->flexibleWheelSearch()->doGetProductIds(), 'wheel size should not precede vehicle for non wheel products' ); }
function testWhenRewritesDisabled_ShouldNotRewriteTitle2() { $config = new Zend_Config(array('seo' => array('rewriteProductName' => false))); $product = $this->getProduct2($config); $product->addVafFit($this->vehicle->toValueArray()); $this->setRequestParams($this->vehicle->toValueArray()); $product->setCurrentlySelectedFit(VF_Singleton::getInstance()->vehicleSelection()); $this->assertEquals('Widget', $product->getName(), 'when rewrites disabled, should not rewrite title'); }
function vafUrl(VF_Vehicle $vehicle) { $params = http_build_query($vehicle->toValueArray()); if ($vehicle->getLeafValue()) { if ('/' == $this->getRequest()->getBasePath()) { return '/vaf/product/list?' . $params; } return $this->getRequest()->getBasePath() . '/vaf/product/list?' . $params; } return '?' . $params; }
function fitsVehicle(VF_Vehicle $vehicle) { $select = $this->getReadAdapter()->select()->from($this->getSchema()->mappingsTable(), array('count(*)'))->where('entity_id = ?', $this->getId()); $params = $vehicle->toValueArray(); foreach ($params as $param => $value) { $select->where($param .= '_id = ?', $value); } $count = $select->query()->fetchColumn(); return 0 != $count; }
function assertVehiclesSame(VF_Vehicle $vehicle1, VF_Vehicle $vehicle2) { $this->assertEquals($vehicle1->toValueArray(), $vehicle2->toValueArray()); }