/** * @dataProvider provideModuleInstances */ public function testCreateDocumentMethod(IModule $module) { $document = $module->createDocument(); $this->assertInstanceOf('Dat0r\\Core\\Document\\Document', $document); }
/** * Creates a document with fake data for the given module. * * @param IModule $module module to create documents for * @param array $options For valid options see fake() method * * @return document newly created with fake data * * @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 function createFakeDocument(IModule $module, array $options = array()) { $options[self::OPTION_MARK_CLEAN] = true; $document = $module->createDocument(); $this->fake($document, $options); return $document; }