function testGetLatestYear()
 {
     $vehicle1 = $this->createVehicle(array('make'=>'Honda','model'=>'civic','year'=>2000));
     $vehicle2 = $this->createVehicle(array('make'=>'Honda','model'=>'civic','year'=>2001));
     $vehicle3 = $this->createVehicle(array('make'=>'Honda','model'=>'civic','year'=>2002));
     $vehicle4 = $this->createVehicle(array('make'=>'Honda','model'=>'civic','year'=>2003));
     $selection = new VF_Vehicle_Selection(array($vehicle2,$vehicle1,$vehicle4,$vehicle3));
     $this->assertEquals(2003, $selection->latestYear());
 }
Ejemplo n.º 2
0
 function testShouldContainVehicleWithinRange()
 {
     $selection = new VF_Vehicle_Selection(array('make' => 'Honda', 'model' => 'Civic', 'year_start' => '2000', 'year_end' => '2005'));
     $this->assertTrue($selection->contains(array('make' => 'Honda', 'model' => 'Civic', 'year' => '2001')), 'should contain a vehicle within the year range');
 }