diff --git a/test/FactoryTest.php b/test/FactoryTest.php index a1111146..40e0589c 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -47,10 +47,7 @@ public function testCreateInputWithInvalidDataTypeThrowsInvalidArgumentException public function testCreateInputWithTypeAsAnUnknownPluginAndNotExistsAsClassNameThrowException(): void { $type = 'foo'; - /** @var InputFilterPluginManager&MockObject $pluginManager */ - $pluginManager = $this->getMockBuilder(InputFilterPluginManager::class) - ->disableOriginalConstructor() - ->getMock(); + $pluginManager = $this->createMock(InputFilterPluginManager::class); $pluginManager->expects($this->atLeastOnce()) ->method('has') ->with($type) @@ -69,9 +66,7 @@ public function testCreateInputWithTypeAsAnUnknownPluginAndNotExistsAsClassNameT public function testGetInputFilterManagerSettedByItsSetter(): void { - $pluginManager = $this->getMockBuilder(InputFilterPluginManager::class) - ->disableOriginalConstructor() - ->getMock(); + $pluginManager = $this->createMock(InputFilterPluginManager::class); $factory = new Factory(); $factory->setInputFilterManager($pluginManager); $this->assertSame($pluginManager, $factory->getInputFilterManager()); @@ -79,9 +74,7 @@ public function testGetInputFilterManagerSettedByItsSetter(): void public function testGetInputFilterManagerWhenYouConstructFactoryWithIt(): void { - $pluginManager = $this->getMockBuilder(InputFilterPluginManager::class) - ->disableOriginalConstructor() - ->getMock(); + $pluginManager = $this->createMock(InputFilterPluginManager::class); $factory = new Factory($pluginManager); $this->assertSame($pluginManager, $factory->getInputFilterManager()); }