GithubHelp home page GithubHelp logo

faker's People

Contributors

jadb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

faker's Issues

'composer require' not pulling through Faker 1.5

As is the way with these things, over the course of writing this issue, I figured out the problem...

When I composer required gourmet/faker, it pulled in the most recent 1.x version which uses fzaninotto/faker 1.4. I had to change to dev-master to get fzaninotto/faker 1.5, which fixed my issue. Could you possibly create a new 1.x.x release so that the 1.5 version of Faker come through by default?

Cheers all.

Fixture fatal error

I am trying to use Faker in my fixtures to generate data for my tests, i tried your fixture example but when i try to run my test i get this error.

Fatal error: Declaration of Gourmet\Faker\TestSuite\Fixture\TestFixture::insert(Cake\Database\Connection $db) must be compatible with Cake\TestSuite\Fixture\TestFixture::insert(Cake\Datasource\ConnectionInterface $db) in C:\laragon\www\my_app_name\vendor\gourmet\faker\src\TestSuite\Fixture\TestFixture.php on line 11
Can you please help me find out what is missing.
My php version is : 7.3.5
My cakephp version : 3.7
fzaninotto/faker: 1.4.*

My PostsFixture

`<?php

namespace App\Test\Fixture;

use Gourmet\Faker\TestSuite\Fixture\TestFixture;

class PostsFixture extends TestFixture {

public $fields = [
    'id' => ['type' => 'integer'],
    'title' => ['type' => 'string', 'length' => 255, 'null' => false],
    'body' => 'text',
    'published' => ['type' => 'integer', 'default' => '0', 'null' => false],
    'created' => 'datetime',
    'updated' => 'datetime',
    '_constraints' => [
        'primary' => ['type' => 'primary', 'columns' => ['id']]
    ]
];

public $records = [
    [
        'id' => 1,
        'title' => 'First Article',
        'body' => 'First Article Body',
        'published' => '1',
        'created' => '2007-03-18 10:39:23',
        'updated' => '2007-03-18 10:41:31'
    ],
    [
        'id' => 2,
        'title' => 'Second Article',
        'body' => 'Second Article Body',
        'published' => '1',
        'created' => '2007-03-18 10:41:23',
        'updated' => '2007-03-18 10:43:31'
    ],
    [
        'id' => 3,
        'title' => 'Third Article',
        'body' => 'Third Article Body',
        'published' => '1',
        'created' => '2007-03-18 10:43:23',
        'updated' => '2007-03-18 10:45:31'
    ]
];

public $number = 20;
public $guessers = ['\Faker\Guesser\Name'];

public function init() {
    $this->customColumnFormatters = [
        'id' => function () { return $this->faker->numberBetween(count($this->records) + 2); },
        'published' => function () { return rand(0,3); }
    ];
    parent::init();
}

}`

Faker version

Not sure if you noticed when doing aab55e7 but Faker v1.4.0 is missing the CakePHP adapters. โ˜”

PHP Fatal error:  Class 'Faker\ORM\CakePHP\EntityPopulator' not found in /vagrant/vendor/gourmet/faker/src/TestSuite/Fixture/TestFixture.php on line 64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.