function testShouldAssociateServiceCodeToVehicle() { $product = $this->newProduct(1); $product = new Elite_Vafdiagram_Model_Catalog_Product($product); $product->addServiceCode(123); $this->import('sku,make,model,year,service_code' . "\n" . ',Honda,Civic,2000,123'); $vehicle = $this->vehicleFinder()->findOneByLevels(array('make' => 'Honda', 'model' => 'Civic', 'year' => '2000')); $vehicle = new Elite_Vafdiagram_Model_Vehicle($vehicle); $this->assertEquals('123', $vehicle->serviceCode(), 'should associate service code to vehicle'); }
function testShouldAddIllustrationID_WithPrefixingZeros() { $product = $this->newProduct(1); $product = new Elite_Vafdiagram_Model_Catalog_Product($product); $product->addServiceCode('0123', array('category1' => 1, 'illustration_id' => '001234')); $product->addServiceCode(456, array('category1' => 2, 'illustration_id' => 4567)); $actual = $product->illustrationID(array('category1' => 1, 'service_code' => '0123')); $this->assertSame('001234', $actual, 'should add illustration ID (with prefixing zeros)'); }