Exemplo n.º 1
0
 /**
  * Setup.
  */
 public static function setupBeforeClass()
 {
     FactoryMuffin::setCustomSaver(function () {
         return true;
     });
     FactoryMuffin::setCustomSetter(function ($object, $name, $value) {
         $name = 'set' . ucfirst(strtolower($name));
         if (method_exists($object, $name)) {
             $object->{$name}($value);
         }
     });
     FactoryMuffin::loadFactories(dirname(__DIR__) . '/Factories');
     FactoryMuffin::setCustomMaker(function ($class) {
         $faker = FactoryMuffin::getFaker();
         return new $class($faker->url);
     });
 }