Skip to content

Commit

Permalink
Fix for issue #8 - vehicleGearBoxType now returns string instead of w…
Browse files Browse the repository at this point in the history
…eighted number (#9)
  • Loading branch information
nickedwards authored and pelmered committed May 29, 2019
1 parent 26aba6e commit 8f88017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Fakecar.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static function vehicleProperties(int $count = 0)
*/
public static function vehicleGearBoxType()
{
return static::randomElement(CarData::getVehicleGearBoxType());
return static::getWeighted(CarData::getVehicleGearBoxType());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Faker/FakecarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testVehicleProperties()

public function testVehicleGearBox()
{
$this->assertTrue(in_array($this->faker->vehicleGearBoxType, CarData::getVehicleGearBoxType()));
$this->assertTrue(in_array($this->faker->vehicleGearBoxType, array_keys(CarData::getVehicleGearBoxType())));
}

public function testGetRandomElementsFromArray()
Expand Down

0 comments on commit 8f88017

Please sign in to comment.