we don't need a fake server instance outside of setUp() in these tests

This commit is contained in:
Dylan K. Taylor
2024-11-20 16:44:00 +00:00
parent d9f5634262
commit d9080f182c
2 changed files with 4 additions and 8 deletions

View File

@@ -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{

View File

@@ -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{