mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
Remove LevelProvider::getProviderName()
This is problematic because child level providers can forget to override the provider name of their parents, and then override them by error. Instead, they should be used in a mapping fashion to make sure they are unique and not inherited. Also, the old method did not permit registering multiple aliases for the same provider. This now makes that possible.
This commit is contained in:
@ -30,24 +30,24 @@ class LevelProviderManagerTest extends TestCase{
|
||||
public function testAddNonClassProvider() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
LevelProviderManager::addProvider("lol");
|
||||
LevelProviderManager::addProvider("lol", "nope");
|
||||
}
|
||||
|
||||
public function testAddAbstractClassProvider() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
LevelProviderManager::addProvider(AbstractLevelProvider::class);
|
||||
LevelProviderManager::addProvider(AbstractLevelProvider::class, "abstract");
|
||||
}
|
||||
|
||||
public function testAddInterfaceProvider() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
LevelProviderManager::addProvider(InterfaceLevelProvider::class);
|
||||
LevelProviderManager::addProvider(InterfaceLevelProvider::class, "interface");
|
||||
}
|
||||
|
||||
public function testAddWrongClassProvider() : void{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
LevelProviderManager::addProvider(LevelProviderManagerTest::class);
|
||||
LevelProviderManager::addProvider(LevelProviderManagerTest::class, "bad_class");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user