Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataFactory Module setLocale Not Working #5

Open
dimacros opened this issue May 8, 2019 · 0 comments
Open

DataFactory Module setLocale Not Working #5

dimacros opened this issue May 8, 2019 · 0 comments

Comments

@dimacros
Copy link

dimacros commented May 8, 2019

I want to change the locale of Faker

Config Extended DataFactory.php

The setLocale configuration is specified in the package: https://github.com/thephpleague/factory-muffin

namespace Helper;

use Codeception\Module\DataFactory as BaseDataFactory;
use League\FactoryMuffin\Faker\Facade as Faker;

class DataFactory extends BaseDataFactory
{
    public function _beforeSuite($settings = [])
    {
        parent::_beforeSuite($settings);
       
        Faker::setLocale('es_PE'); //Not Working
    }
}

Details

  • Codeception version: 3.0
  • PHP Version: 7.2.17
  • Operating System: Linux
  • Installation type: Composer
  • Suite api.suite.yml configuration:
class_name: ApiTester
modules:
    enabled:
        - Symfony:
            app_path: 'app'
            var_path: 'var'
            environment: 'test'
        - REST:
            url: /api
            depends: Symfony
        - Doctrine2:
            cleanup: true
            depends: Symfony
        - Helper\DataFactory:
            cleanup: true
            depends: Doctrine2
            factories: tests/_support/factories
        - \Helper\Api
@Naktibalda Naktibalda transferred this issue from Codeception/Codeception Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant