Questions tagged [faker]

An extension or library used in certain programming languages or frameworks (namely Ruby or Yii2) for generating fake data for debug purposes and testing.

In Ruby, Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.

In Yii2, Faker can generate random strings (like name, address, phone number or anything), random numbers, keys or harshes as well as long sentences of fake text. It can be accessed in OOP style.

A PHP library is available for Faker that is used in some frameworks such as Laravel.

703 questions
0
votes
1 answer

Laravel/faker using invalid column names

I'm running a Laravel 5.4 project created just three days ago. I have this in my ModelFactory.php: $factory->define(\App\Models\Definition::class, function (Faker\Generator $faker) { $tag = "tag"; $category = "cat"; return [ 'name' =>…
shalvah
  • 881
  • 10
  • 21
0
votes
1 answer

Laravel 5 /Carbon : Unexpected data found / data missing

I have no idea where to start now. I m just getting started with Laravel and trying to seed a database with random data, using Carbon & Faker. I got this error message : [InvalidArgumentException] Unexpected data found. Unexpected data…
DevMoutarde
  • 599
  • 7
  • 21
0
votes
0 answers

Uninitialized constant FAKER when "seeding" db

I am trying to seed a db using the gem faker but keep getting: rails aborted! NameError: uninitialised constant FAKER when running rails db:seed Initially I though it was a problem with my project so I created a new clean one, added gem 'faker' to…
0r4cl3
  • 132
  • 8
0
votes
1 answer

Nativescript error for faker: cannot find module './address'

I am learning nativescript. I am trying to use faker to create some data with typescript. Node version - 6.9.4 Faker - 3.1.0 typescript - 2.1.4 I got this error and haven't been able to run the app. 1 0x103841709…
wizardo
  • 35
  • 4
0
votes
0 answers

create posts with devise user id using rake and faker gem

I am a noobie. I am trying to generate fake data with faker gem using rake populate task I am getting error Validation failed User must exist. Here is my task file: namespace :db do desc "Fill database with test data" task populate:…
Ahmed
  • 54
  • 5
0
votes
3 answers

Python faker - Syntax error - CSV file

Python Syntax Error - CSV file input: I'm trying to use CSV masking test for an implementation and picked up use case from masking using faker. Picked up the sample code from the link and trying to execute the program. But I'm getting syntax error…
saran
  • 3
  • 6
0
votes
1 answer

Python - Data Masking - Faker - fake.name error

I'm trying to use Python faker and fake-factory for Data masking in my application. I have executed the following test python script but getting syntax error. Please help me out. #faker script files # coding=utf-8 from faker import…
saran
  • 3
  • 6
0
votes
1 answer

Faker Gem to Specific Values?

Assuming I have a simple factory: FactoryGirl.define do factory :state do name Faker::Address.state_abbr end end For instance, most of our unit tests used are 'ok' with having a random state_abbr for instance. However, I have some…
msmith1114
  • 2,717
  • 3
  • 33
  • 84
0
votes
1 answer

using faker to create a json file

I am trying to create a faker js file that will create a json file with 25 random user data. First I start with an empty army, then open a for loop and place the faker inside, then push the data and print it to a json file but it doesn't seem to…
Rebekah
  • 57
  • 1
  • 2
  • 11
0
votes
0 answers

Picking a random enum

I've created a simpel model like this: using System; using System.Collections.Generic; namespace Resa.Models { public enum GenderType : byte { Unknown = 0, Male = 1, Female = 2, NotApplicable = 9 } public class Profile { public…
0
votes
1 answer

Laravel: Error when run Seeder

I get an error when create a table seeder using model factory in laravel 5.3 but I don't know where I'm going wrong here. [ErrorException] Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, string given,…
Tri
  • 161
  • 12
0
votes
1 answer

how faker $generator property allow us to call formatters of other providers

I am new to faker and also quite new to PHP. My question is rather towards how PHP works. For my question, I take Faker (a PHP library that generates fake data) as an example. For reference the url…
Rendy Tan
  • 1
  • 1
0
votes
1 answer

How to use Fabricate-gem to generate objects?

I'm using Rails 4, Fabricate and Faker Gems. And I'm trying to seed my database with (100 or so) randomly created objects (Order that contains up to 3 Ice Creams). I followed This Answer that recommend using this approach. models/order.rb class…
0
votes
1 answer

How can i use Faker.js to generate random data for protractor test cases.?

I would like to generate random input for protractor using faker.js. Please provide a way for using faker.js with protractor.
albert
  • 369
  • 2
  • 5
  • 16
0
votes
1 answer

Runnin Faker locally and on production creates different set of Id's

I am using Laravel 5.3 and creating some data using Faker when running locally this code $factory->define(App\User::class, function (Faker\Generator $faker) { $username = str_replace(".","",$faker->username); return [ 'username' =>…
niko craft
  • 2,893
  • 5
  • 38
  • 67