update tests to use new factories

This commit is contained in:
Matthew Penner
2021-01-15 18:24:10 -07:00
parent 0330716174
commit ebc6efc5f4
58 changed files with 270 additions and 231 deletions

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property int $node_id
@@ -21,6 +23,8 @@ namespace Pterodactyl\Models;
*/
class Allocation extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -3,6 +3,7 @@
namespace Pterodactyl\Models;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -18,6 +19,12 @@ use Pterodactyl\Services\Acl\Api\AdminAcl;
*/
class ApiKey extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.
*/
const RESOURCE_NAME = 'api_key';
/**

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property int $server_id
@@ -19,6 +21,8 @@ namespace Pterodactyl\Models;
*/
class Database extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -2,8 +2,12 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class DatabaseHost extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property string $uuid
@@ -46,6 +48,8 @@ namespace Pterodactyl\Models;
*/
class Egg extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property int $egg_id
@@ -25,6 +27,8 @@ namespace Pterodactyl\Models;
*/
class EggVariable extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property string $short
@@ -14,6 +16,8 @@ namespace Pterodactyl\Models;
*/
class Location extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -2,6 +2,8 @@
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
* @property string $uuid
@@ -16,6 +18,8 @@ namespace Pterodactyl\Models;
*/
class Nest extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -6,6 +6,7 @@ use Symfony\Component\Yaml\Yaml;
use Illuminate\Container\Container;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -38,6 +39,7 @@ use Illuminate\Contracts\Encryption\Encrypter;
*/
class Node extends Model
{
use HasFactory;
use Notifiable;
/**

View File

@@ -6,6 +6,7 @@ use Cron\CronExpression;
use Carbon\CarbonImmutable;
use Illuminate\Container\Container;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -29,6 +30,8 @@ use Pterodactyl\Contracts\Extensions\HashidsInterface;
*/
class Schedule extends Model
{
use HasFactory;
/**
* The resource name for this model when it is transformed into an
* API representation using fractal.

View File

@@ -5,6 +5,7 @@ namespace Pterodactyl\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Query\JoinClause;
use Znck\Eloquent\Traits\BelongsToThrough;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -54,6 +55,7 @@ use Znck\Eloquent\Traits\BelongsToThrough;
class Server extends Model
{
use BelongsToThrough;
use HasFactory;
use Notifiable;
/**

View File

@@ -3,6 +3,7 @@
namespace Pterodactyl\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -17,6 +18,7 @@ use Illuminate\Notifications\Notifiable;
*/
class Subuser extends Model
{
use HasFactory;
use Notifiable;
/**

View File

@@ -5,6 +5,7 @@ namespace Pterodactyl\Models;
use Illuminate\Container\Container;
use Znck\Eloquent\Traits\BelongsToThrough;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
@@ -25,6 +26,7 @@ use Pterodactyl\Contracts\Extensions\HashidsInterface;
class Task extends Model
{
use BelongsToThrough;
use HasFactory;
/**
* The resource name for this model when it is transformed into an

View File

@@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\Builder;
use Illuminate\Auth\Passwords\CanResetPassword;
use Pterodactyl\Traits\Helpers\AvailableLanguages;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
@@ -49,6 +50,7 @@ class User extends Model implements
use Authorizable;
use AvailableLanguages;
use CanResetPassword;
use HasFactory;
use Notifiable;
const USER_LEVEL_USER = 0;