Fix node update tests
This commit is contained in:
parent
a5d9faf6b2
commit
83a59cdf4f
10 changed files with 227 additions and 363 deletions
|
@ -12,6 +12,7 @@ namespace Tests\Unit\Services\Nodes;
|
|||
use Mockery as m;
|
||||
use Tests\TestCase;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
use Illuminate\Contracts\Translation\Translator;
|
||||
use Pterodactyl\Services\Nodes\NodeDeletionService;
|
||||
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
|
||||
|
@ -71,11 +72,11 @@ class NodeDeletionServiceTest extends TestCase
|
|||
|
||||
/**
|
||||
* Test that an exception is thrown if servers are attached to the node.
|
||||
*
|
||||
* @expectedException \Pterodactyl\Exceptions\DisplayException
|
||||
*/
|
||||
public function testExceptionIsThrownIfServersAreAttachedToNode()
|
||||
{
|
||||
$this->expectException(DisplayException::class);
|
||||
|
||||
$this->serverRepository->shouldReceive('setColumns')->with('id')->once()->andReturnSelf()
|
||||
->shouldReceive('findCountWhere')->with([['node_id', '=', 1]])->once()->andReturn(1);
|
||||
$this->translator->shouldReceive('trans')->with('exceptions.node.servers_attached')->once()->andReturnNull();
|
||||
|
|
Reference in a new issue