PMCORE-3880 PhpUnit: Error: Call to undefined function factory
This commit is contained in:
@@ -1,17 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
namespace Database\Factories;
|
||||
|
||||
$factory->define(\ProcessMaker\Model\OauthClients::class, function(Faker $faker) {
|
||||
return [
|
||||
"CLIENT_ID" => $faker->unique()->word(),
|
||||
"CLIENT_SECRET" => $faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_NAME" => $faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_DESCRIPTION" => $faker->text,
|
||||
"CLIENT_WEBSITE" => $faker->url,
|
||||
"REDIRECT_URI" => $faker->url,
|
||||
"USR_UID" => function() {
|
||||
return factory(\ProcessMaker\Model\User::class)->create()->USR_UID;
|
||||
}
|
||||
];
|
||||
});
|
||||
use App\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class OauthClientsFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
"CLIENT_ID" => $this->faker->unique()->word(),
|
||||
"CLIENT_SECRET" => $this->faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_NAME" => $this->faker->regexify("/[a-zA-Z]{6}/"),
|
||||
"CLIENT_DESCRIPTION" => $this->faker->text,
|
||||
"CLIENT_WEBSITE" => $this->faker->url,
|
||||
"REDIRECT_URI" => $this->faker->url,
|
||||
"USR_UID" => function () {
|
||||
return \ProcessMaker\Model\User::factory()->create()->USR_UID;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user