Closed mabasic closed 9 years ago
TestDummy only works with 'string', 'integer', 'date', 'text', 'boolean' and 'uuid' keyword
<?php namespace Laracasts\TestDummy;
use Faker\Factory as Faker;
class DynamicAttributeReplacer {
...
...
/**
* Supported fake types
*
* @var array
*/
protected $supportedFakes = [
'string', 'integer', 'date', 'text', 'boolean', 'uuid',
];
This is my solution
Add the keywords you want
protected $supportedFakes = [
'string', 'integer', 'date', 'text', 'boolean', 'uuid',
'latitude', 'longitude', 'address'
];
Add some methods for them
public function getFakeLatitude(){
return $this->fake->latitude;
}
public function getFakeLongitude(){
return $this->fake->longitude;
}
public function getFakeAddress(){
return $this->fake->address;
}
I cannot get this to work either. And the readme says otherwise?
However, in addition to those, TestDummy will recognize all supported Faker properties. As such, we can do things like:
Yeah, v1.3 only :) My bad.
How can I use any one of these in fixtures.yml?
I have tried:
But it does not work. Any ideas ?