AsyncPool: Remove Server dependency (API breaks included)

This brings two plugin-breaking changes: AsyncTask->onCompletion() and AsyncTask->onProgressUpdate() no longer accept Server parameters.

This now allows for the functionality of AsyncPool and AsyncTask to be tested outside of a Server.
This commit is contained in:
Dylan K. Taylor
2018-09-10 15:47:12 +01:00
parent 5ce2d5e072
commit d62e00cc74
11 changed files with 19 additions and 40 deletions

View File

@ -25,7 +25,6 @@ namespace pmmp\TesterPlugin\tests;
use pmmp\TesterPlugin\Test;
use pocketmine\scheduler\AsyncTask;
use pocketmine\Server;
use pocketmine\utils\MainLogger;
class AsyncTaskMainLoggerTest extends Test{
@ -49,7 +48,7 @@ class AsyncTaskMainLoggerTest extends Test{
ob_end_flush();
}
public function onCompletion(Server $server){
public function onCompletion(){
/** @var AsyncTaskMainLoggerTest $test */
$test = $this->fetchLocal();
$test->setResult($this->success ? Test::RESULT_OK : Test::RESULT_FAILED);