mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
we don't need a fake server instance outside of setUp() in these tests
This commit is contained in:
parent
d9f5634262
commit
d9080f182c
@ -35,8 +35,6 @@ use function count;
|
||||
final class AsyncEventConcurrencyTest extends TestCase{
|
||||
|
||||
private Plugin $mockPlugin;
|
||||
private Server $mockServer;
|
||||
|
||||
private PluginManager $pluginManager;
|
||||
|
||||
//this one gets its own class because it requires a bunch of context variables
|
||||
@ -57,10 +55,10 @@ final class AsyncEventConcurrencyTest extends TestCase{
|
||||
|
||||
//TODO: this is a really bad hack and could break any time if PluginManager decides to access its Server field
|
||||
//we really need to make it possible to register events without a Plugin or Server context
|
||||
$this->mockServer = $this->createMock(Server::class);
|
||||
$mockServer = $this->createMock(Server::class);
|
||||
$this->mockPlugin = self::createStub(Plugin::class);
|
||||
$this->mockPlugin->method('isEnabled')->willReturn(true);
|
||||
$this->pluginManager = new PluginManager($this->mockServer, null);
|
||||
$this->pluginManager = new PluginManager($mockServer, null);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass() : void{
|
||||
|
@ -35,8 +35,6 @@ use pocketmine\Server;
|
||||
use function shuffle;
|
||||
|
||||
final class AsyncEventTest extends TestCase{
|
||||
|
||||
private Server $mockServer;
|
||||
private Plugin $mockPlugin;
|
||||
private PluginManager $pluginManager;
|
||||
|
||||
@ -45,10 +43,10 @@ final class AsyncEventTest extends TestCase{
|
||||
|
||||
//TODO: this is a really bad hack and could break any time if PluginManager decides to access its Server field
|
||||
//we really need to make it possible to register events without a Plugin or Server context
|
||||
$this->mockServer = $this->createMock(Server::class);
|
||||
$mockServer = $this->createMock(Server::class);
|
||||
$this->mockPlugin = self::createStub(Plugin::class);
|
||||
$this->mockPlugin->method('isEnabled')->willReturn(true);
|
||||
$this->pluginManager = new PluginManager($this->mockServer, null);
|
||||
$this->pluginManager = new PluginManager($mockServer, null);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass() : void{
|
||||
|
Loading…
x
Reference in New Issue
Block a user