First go at integration tests
This commit is contained in:
parent
89db9390df
commit
e2aa01c9cc
16 changed files with 610 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -34,6 +35,8 @@ $factory->define(Pterodactyl\Models\Server::class, function (Faker $faker) {
|
|||
'egg_id' => $faker->randomNumber(),
|
||||
'pack_id' => null,
|
||||
'installed' => 1,
|
||||
'database_limit' => null,
|
||||
'allocation_limit' => null,
|
||||
'created_at' => \Carbon\Carbon::now(),
|
||||
'updated_at' => \Carbon\Carbon::now(),
|
||||
];
|
||||
|
@ -74,7 +77,6 @@ $factory->define(Pterodactyl\Models\Location::class, function (Faker $faker) {
|
|||
$factory->define(Pterodactyl\Models\Node::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->randomNumber(),
|
||||
'uuid' => $faker->unique()->uuid,
|
||||
'public' => true,
|
||||
'name' => $faker->firstName,
|
||||
'fqdn' => $faker->ipv4,
|
||||
|
@ -224,21 +226,17 @@ $factory->define(Pterodactyl\Models\DaemonKey::class, function (Faker $faker) {
|
|||
});
|
||||
|
||||
$factory->define(Pterodactyl\Models\ApiKey::class, function (Faker $faker) {
|
||||
static $token;
|
||||
|
||||
return [
|
||||
'id' => $faker->unique()->randomNumber(),
|
||||
'user_id' => $faker->randomNumber(),
|
||||
'key_type' => ApiKey::TYPE_APPLICATION,
|
||||
'identifier' => str_random(Pterodactyl\Models\ApiKey::IDENTIFIER_LENGTH),
|
||||
'token' => 'encrypted_string',
|
||||
'token' => $token ?: $token = encrypt(str_random(Pterodactyl\Models\ApiKey::KEY_LENGTH)),
|
||||
'allowed_ips' => null,
|
||||
'memo' => 'Test Function Key',
|
||||
'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
|
||||
'updated_at' => \Carbon\Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(Pterodactyl\Models\APIPermission::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->randomNumber(),
|
||||
'key_id' => $faker->randomNumber(),
|
||||
'permission' => mb_strtolower($faker->word),
|
||||
];
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue