Update to Laravel 8
Co-authored-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
parent
028921b42a
commit
a043071e3c
211 changed files with 4394 additions and 2933 deletions
|
@ -1,15 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Tests\Unit\Helpers;
|
||||
namespace Pterodactyl\Tests\Unit\Helpers;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Pterodactyl\Tests\TestCase;
|
||||
|
||||
class IsDigitTest extends TestCase
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Http\Middleware\AdminAuthenticate;
|
||||
|
@ -13,7 +13,7 @@ class AdminAuthenticateTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testAdminsAreAuthenticated()
|
||||
{
|
||||
$user = factory(User::class)->make(['root_admin' => 1]);
|
||||
$user = User::factory()->make(['root_admin' => 1]);
|
||||
|
||||
$this->request->shouldReceive('user')->withNoArgs()->twice()->andReturn($user);
|
||||
|
||||
|
@ -39,7 +39,7 @@ class AdminAuthenticateTest extends MiddlewareTestCase
|
|||
{
|
||||
$this->expectException(AccessDeniedHttpException::class);
|
||||
|
||||
$user = factory(User::class)->make(['root_admin' => 0]);
|
||||
$user = User::factory()->make(['root_admin' => 0]);
|
||||
|
||||
$this->request->shouldReceive('user')->withNoArgs()->twice()->andReturn($user);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Api\Application;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Api\Application;
|
||||
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Pterodactyl\Http\Middleware\Api\Application\AuthenticateApplicationUser;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Api;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Api;
|
||||
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Http\Middleware\Api\AuthenticateIPAccess;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
||||
class AuthenticateIPAccessTest extends MiddlewareTestCase
|
||||
|
@ -14,7 +14,7 @@ class AuthenticateIPAccessTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testWithNoIPRestrictions()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make(['allowed_ips' => []]);
|
||||
$model = ApiKey::factory()->make(['allowed_ips' => []]);
|
||||
$this->setRequestAttribute('api_key', $model);
|
||||
|
||||
$this->getMiddleware()->handle($this->request, $this->getClosureAssertions());
|
||||
|
@ -26,7 +26,7 @@ class AuthenticateIPAccessTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testWithValidIP()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make(['allowed_ips' => ['127.0.0.1']]);
|
||||
$model = ApiKey::factory()->make(['allowed_ips' => ['127.0.0.1']]);
|
||||
$this->setRequestAttribute('api_key', $model);
|
||||
|
||||
$this->request->shouldReceive('ip')->withNoArgs()->once()->andReturn('127.0.0.1');
|
||||
|
@ -39,7 +39,7 @@ class AuthenticateIPAccessTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testValidIPAgainstCIDRRange()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make(['allowed_ips' => ['192.168.1.1/28']]);
|
||||
$model = ApiKey::factory()->make(['allowed_ips' => ['192.168.1.1/28']]);
|
||||
$this->setRequestAttribute('api_key', $model);
|
||||
|
||||
$this->request->shouldReceive('ip')->withNoArgs()->once()->andReturn('192.168.1.15');
|
||||
|
@ -55,7 +55,7 @@ class AuthenticateIPAccessTest extends MiddlewareTestCase
|
|||
{
|
||||
$this->expectException(AccessDeniedHttpException::class);
|
||||
|
||||
$model = factory(ApiKey::class)->make(['allowed_ips' => ['127.0.0.1']]);
|
||||
$model = ApiKey::factory()->make(['allowed_ips' => ['127.0.0.1']]);
|
||||
$this->setRequestAttribute('api_key', $model);
|
||||
|
||||
$this->request->shouldReceive('ip')->withNoArgs()->twice()->andReturn('127.0.0.2');
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Api;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Api;
|
||||
|
||||
use Mockery as m;
|
||||
use Cake\Chronos\Chronos;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
use Illuminate\Auth\AuthManager;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Http\Middleware\Api\AuthenticateKey;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
||||
|
@ -38,7 +38,6 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Chronos::setTestNow(Chronos::now());
|
||||
|
||||
$this->auth = m::mock(AuthManager::class);
|
||||
$this->encrypter = m::mock(Encrypter::class);
|
||||
|
@ -79,7 +78,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testValidToken()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->request->shouldReceive('bearerToken')->withNoArgs()->twice()->andReturn($model->identifier . 'decrypted');
|
||||
$this->repository->shouldReceive('findFirstWhere')->with([
|
||||
|
@ -90,7 +89,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
$this->auth->shouldReceive('guard->loginUsingId')->with($model->user_id)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [
|
||||
'last_used_at' => Chronos::now(),
|
||||
'last_used_at' => CarbonImmutable::now(),
|
||||
])->once()->andReturnNull();
|
||||
|
||||
$this->getMiddleware()->handle($this->request, $this->getClosureAssertions(), ApiKey::TYPE_APPLICATION);
|
||||
|
@ -102,7 +101,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testValidTokenWithUserKey()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->request->shouldReceive('bearerToken')->withNoArgs()->twice()->andReturn($model->identifier . 'decrypted');
|
||||
$this->repository->shouldReceive('findFirstWhere')->with([
|
||||
|
@ -113,7 +112,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
$this->auth->shouldReceive('guard->loginUsingId')->with($model->user_id)->once()->andReturnNull();
|
||||
|
||||
$this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [
|
||||
'last_used_at' => Chronos::now(),
|
||||
'last_used_at' => CarbonImmutable::now(),
|
||||
])->once()->andReturnNull();
|
||||
|
||||
$this->getMiddleware()->handle($this->request, $this->getClosureAssertions(), ApiKey::TYPE_ACCOUNT);
|
||||
|
@ -126,7 +125,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testAccessWithoutToken()
|
||||
{
|
||||
$user = factory(User::class)->make(['id' => 123]);
|
||||
$user = User::factory()->make(['id' => 123]);
|
||||
|
||||
$this->request->shouldReceive('user')->andReturn($user);
|
||||
$this->request->shouldReceive('bearerToken')->withNoArgs()->twice()->andReturnNull();
|
||||
|
@ -147,7 +146,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase
|
|||
{
|
||||
$this->expectException(AccessDeniedHttpException::class);
|
||||
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->request->shouldReceive('bearerToken')->withNoArgs()->twice()->andReturn($model->identifier . 'asdf');
|
||||
$this->repository->shouldReceive('findFirstWhere')->with([
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Api\Daemon;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Api\Daemon;
|
||||
|
||||
use Mockery as m;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Repositories\Eloquent\NodeRepository;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Pterodactyl\Http\Middleware\Api\Daemon\DaemonAuthenticate;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
||||
|
@ -92,7 +92,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase
|
|||
$this->expectException(AccessDeniedHttpException::class);
|
||||
|
||||
/** @var \Pterodactyl\Models\Node $model */
|
||||
$model = factory(Node::class)->make();
|
||||
$model = Node::factory()->make();
|
||||
|
||||
$this->request->expects('route->getName')->withNoArgs()->andReturn('random.route');
|
||||
$this->request->expects('bearerToken')->withNoArgs()->andReturn($model->daemon_token_id . '.random_string_123');
|
||||
|
@ -125,7 +125,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase
|
|||
public function testSuccessfulMiddlewareProcess()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\Node $model */
|
||||
$model = factory(Node::class)->make();
|
||||
$model = Node::factory()->make();
|
||||
|
||||
$this->request->expects('route->getName')->withNoArgs()->andReturn('random.route');
|
||||
$this->request->expects('bearerToken')->withNoArgs()->andReturn($model->daemon_token_id . '.' . decrypt($model->daemon_token));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Api;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Api;
|
||||
|
||||
use Mockery as m;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Http\Middleware\Api\SetSessionDriver;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
|
||||
class SetSessionDriverTest extends MiddlewareTestCase
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Pterodactyl\Http\Middleware\Authenticate;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Mockery as m;
|
||||
use Pterodactyl\Models\User;
|
||||
|
@ -40,7 +40,7 @@ class LanguageMiddlewareTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testLanguageIsSetWithAuthenticatedUser()
|
||||
{
|
||||
$user = factory(User::class)->make(['language' => 'de']);
|
||||
$user = User::factory()->make(['language' => 'de']);
|
||||
|
||||
$this->request->shouldReceive('user')->withNoArgs()->andReturn($user);
|
||||
$this->appMock->shouldReceive('setLocale')->with('de')->once()->andReturnNull();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Mockery as m;
|
||||
use Pterodactyl\Models\Node;
|
||||
|
@ -31,8 +31,8 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testHandle()
|
||||
{
|
||||
$server = factory(Server::class)->make();
|
||||
$node = factory(Node::class)->make(['maintenance' => 0]);
|
||||
$server = Server::factory()->make();
|
||||
$node = Node::factory()->make(['maintenance' => 0]);
|
||||
|
||||
$server->setRelation('node', $node);
|
||||
$this->setRequestAttribute('server', $server);
|
||||
|
@ -45,8 +45,8 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testHandleInMaintenanceMode()
|
||||
{
|
||||
$server = factory(Server::class)->make();
|
||||
$node = factory(Node::class)->make(['maintenance_mode' => 1]);
|
||||
$server = Server::factory()->make();
|
||||
$node = Node::factory()->make(['maintenance_mode' => 1]);
|
||||
|
||||
$server->setRelation('node', $node);
|
||||
$this->setRequestAttribute('server', $server);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Tests\Traits\Http\RequestMockHelpers;
|
||||
use Tests\Traits\Http\MocksMiddlewareClosure;
|
||||
use Tests\Assertions\MiddlewareAttributeAssertionsTrait;
|
||||
use Pterodactyl\Tests\TestCase;
|
||||
use Pterodactyl\Tests\Traits\Http\RequestMockHelpers;
|
||||
use Pterodactyl\Tests\Traits\Http\MocksMiddlewareClosure;
|
||||
use Pterodactyl\Tests\Assertions\MiddlewareAttributeAssertionsTrait;
|
||||
|
||||
abstract class MiddlewareTestCase extends TestCase
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware;
|
||||
|
||||
use Mockery as m;
|
||||
use Illuminate\Auth\AuthManager;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Http\Middleware\Server;
|
||||
namespace Pterodactyl\Tests\Unit\Http\Middleware\Server;
|
||||
|
||||
use Mockery as m;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Http\Middleware\Server\AccessingValidServer;
|
||||
use Pterodactyl\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
@ -49,7 +49,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
|
|||
$this->expectException(AccessDeniedHttpException::class);
|
||||
$this->expectExceptionMessage('Server is suspended and cannot be accessed.');
|
||||
|
||||
$model = factory(Server::class)->make(['suspended' => 1]);
|
||||
$model = Server::factory()->make(['suspended' => 1]);
|
||||
|
||||
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
|
||||
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(true);
|
||||
|
@ -67,7 +67,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
|
|||
$this->expectException(ConflictHttpException::class);
|
||||
$this->expectExceptionMessage('Server is still completing the installation process.');
|
||||
|
||||
$model = factory(Server::class)->make(['installed' => 0]);
|
||||
$model = Server::factory()->make(['installed' => 0]);
|
||||
|
||||
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
|
||||
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(true);
|
||||
|
@ -101,7 +101,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
|
|||
*/
|
||||
public function testValidServerProcess()
|
||||
{
|
||||
$model = factory(Server::class)->make();
|
||||
$model = Server::factory()->make();
|
||||
|
||||
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
|
||||
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(false);
|
||||
|
@ -126,9 +126,9 @@ class AccessingValidServerTest extends MiddlewareTestCase
|
|||
$this->refreshApplication();
|
||||
|
||||
return [
|
||||
[factory(Server::class)->make(['suspended' => 1]), 'errors.suspended', 403],
|
||||
[factory(Server::class)->make(['installed' => 0]), 'errors.installing', 409],
|
||||
[factory(Server::class)->make(['installed' => 2]), 'errors.installing', 409],
|
||||
[Server::factory()->make(['suspended' => 1]), 'errors.suspended', 403],
|
||||
[Server::factory()->make(['installed' => 0]), 'errors.installing', 409],
|
||||
[Server::factory()->make(['installed' => 2]), 'errors.installing', 409],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Rules;
|
||||
namespace Pterodactyl\Tests\Unit\Rules;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Pterodactyl\Rules\Username;
|
||||
use Pterodactyl\Tests\TestCase;
|
||||
|
||||
class UsernameTest extends TestCase
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Services\Acl\Api;
|
||||
namespace Pterodactyl\Tests\Unit\Services\Acl\Api;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
use Pterodactyl\Tests\TestCase;
|
||||
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
||||
|
||||
class AdminAclTest extends TestCase
|
||||
|
@ -23,7 +23,7 @@ class AdminAclTest extends TestCase
|
|||
*/
|
||||
public function testCheck()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make(['r_servers' => AdminAcl::READ | AdminAcl::WRITE]);
|
||||
$model = ApiKey::factory()->make(['r_servers' => AdminAcl::READ | AdminAcl::WRITE]);
|
||||
|
||||
$this->assertTrue(AdminAcl::check($model, AdminAcl::RESOURCE_SERVERS, AdminAcl::WRITE));
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Services\Api;
|
||||
namespace Pterodactyl\Tests\Unit\Services\Api;
|
||||
|
||||
use Mockery as m;
|
||||
use Tests\TestCase;
|
||||
use phpmock\phpunit\PHPMock;
|
||||
use Pterodactyl\Models\ApiKey;
|
||||
use Pterodactyl\Tests\TestCase;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Pterodactyl\Services\Api\KeyCreationService;
|
||||
use Pterodactyl\Contracts\Repository\ApiKeyRepositoryInterface;
|
||||
|
@ -40,7 +40,7 @@ class KeyCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testKeyIsCreated()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->getFunctionMock('\\Pterodactyl\\Services\\Api', 'str_random')
|
||||
->expects($this->exactly(2))->willReturnCallback(function ($length) {
|
||||
|
@ -68,7 +68,7 @@ class KeyCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testIdentifierAndTokenAreOnlySetByFunction()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->getFunctionMock('\\Pterodactyl\\Services\\Api', 'str_random')
|
||||
->expects($this->exactly(2))->willReturnCallback(function ($length) {
|
||||
|
@ -95,7 +95,7 @@ class KeyCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testPermissionsAreRetrievedForApplicationKeys()
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->getFunctionMock('\\Pterodactyl\\Services\\Api', 'str_random')
|
||||
->expects($this->exactly(2))->willReturnCallback(function ($length) {
|
||||
|
@ -125,7 +125,7 @@ class KeyCreationServiceTest extends TestCase
|
|||
*/
|
||||
public function testPermissionsAreNotRetrievedForNonApplicationKeys($keyType)
|
||||
{
|
||||
$model = factory(ApiKey::class)->make();
|
||||
$model = ApiKey::factory()->make();
|
||||
|
||||
$this->getFunctionMock('\\Pterodactyl\\Services\\Api', 'str_random')
|
||||
->expects($this->exactly(2))->willReturnCallback(function ($length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue