Exemple #1
0
 /**
  * Creates an array with fake data for the given type.
  *
  * @param EntityTypeInterface $type type to create fake data for
  * @param array $options For valid options see fill() method
  *
  * @return array of fake data for the given type
  *
  * @throws \Trellis\Runtime\Entity\InvalidValueException in case of fake data being invalid for the given attribute
  * @throws \Trellis\Runtime\Entity\BadValueException in case of invalid locale option string
  * @throws \Trellis\Common\Error\RuntimeException on EmbeddedEntityListAttribute misconfiguration
  */
 public static function createDataFor(EntityTypeInterface $type, array $options = array())
 {
     $data_generator = new static();
     return $data_generator->fakeData($type, $options);
 }
Exemple #2
0
 /**
  * Creates an array with fake data for the given module.
  *
  * @param IModule $module module to create fake data for
  * @param array $options For valid options see fill() method
  *
  * @return array of fake data for the given module
  *
  * @throws \Dat0r\Core\Document\InvalidValueException in case of fake data being invalid for the given field
  * @throws \InvalidArgumentException in case of invalid locale option string
  * @throws \Dat0r\Core\Error\LogicException on AggregateField misconfiguration
  * @throws \Dat0r\Core\Error\InvalidImplementorException on various misconfigurations
  * @throws \Dat0r\Core\Error\ObjectImmutableException if an instance is frozen (closed to modifications)
  */
 public static function createDataFor(IModule $module, array $options = array())
 {
     $data_generator = new static();
     return $data_generator->fakeData($module, $options);
 }