diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php index f00c990391c67588340e6af37ad8c1c45868d57b..cbe4a82109d48d79977cfce9e40535497daa7c9e 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php @@ -98,7 +98,9 @@ class ILSTest extends \VuFindTest\Unit\DbTestCase $driver = $this->getMockDriver(); } $authenticator = $this->getMockILSAuthenticator($patron); - $driverManager = new \VuFind\ILS\Driver\PluginManager(); + $driverManager = new \VuFind\ILS\Driver\PluginManager( + $this->getServiceManager() + ); $driverManager->setService('Sample', $driver); $mockConfigReader = $this->createMock('VuFind\Config\PluginManager'); $mockConfigReader->expects($this->any())->method('get') diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php index 5b34119718463ae5fe999e8052617831baee3680..262ebd02e2a19597479a00b7876d8f41b70ec910 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php @@ -110,11 +110,11 @@ class MultiAuthTest extends \VuFindTest\Unit\DbTestCase * Test login with handler configured to load a service which does not exist. * * @return void + * + * @expectedException Zend\ServiceManager\Exception\ServiceNotFoundException */ public function testLoginWithBadService() { - $this - ->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); $config = $this->getAuthConfig(); $config->MultiAuth->method_order = 'InappropriateService,Database'; @@ -128,11 +128,11 @@ class MultiAuthTest extends \VuFindTest\Unit\DbTestCase * as an arbitrary inappropriate class). * * @return void + * + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException */ public function testLoginWithBadClass() { - $this - ->setExpectedException('Zend\ServiceManager\Exception\RuntimeException'); $config = $this->getAuthConfig(); $config->MultiAuth->method_order = get_class($this) . ',Database'; diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php index 9ab74130067c9e847e7238b3750fa398e6fe8ff1..a94afc6617cae087b0027c871f130a739e96201d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Auth\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php index ef64a713d60b4cf3af1eb6a8b70d160896bd85fa..e788a81ed2aaeae284daf6c93d643a63fa5b77ee 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Autocomplete\AutocompleteInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php index 60ccd9150b034410f1345df51c9f0baafd8b7fc7..0762c4c71e1882f2b35c234bec29677a7c3b17ed 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php @@ -134,9 +134,8 @@ class PluginFactoryTest extends \VuFindTest\Unit\TestCase */ protected function getConfig($name) { - return $this->factory->createServiceWithName( - $this->createMock('Zend\ServiceManager\ServiceLocatorInterface'), - $name, $name + return $this->factory->__invoke( + $this->createMock('Interop\Container\ContainerInterface'), $name ); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/AuthorNotes/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/AuthorNotes/PluginManagerTest.php index 43c7ec432fd63615052341b81f6e5d906f9be61f..5a9bbbe2e718d173ae866f68113fa2b7c9b0e167 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/AuthorNotes/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/AuthorNotes/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Content\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/PluginManagerTest.php index 3551931bde408c899e8003776393e01be90305ae..b9d1222761ffb6558b1258b2fdcf3f1528d2cafa 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Covers/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Content\AbstractCover */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Excerpts/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Excerpts/PluginManagerTest.php index 4ff8387ab55070b3e301689435e73299d2e11e73..8dd428924e1486a104c7446ad0e914a83434b24e 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Excerpts/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Excerpts/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Content\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php index 34d86a4057f21e3e43d63f0e489b52f875ad912a..726b35e47c192ad4dbe7f3e04367f05df932a2ce 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Content\Loader */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Reviews/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Reviews/PluginManagerTest.php index bfb02796e1ea1c9245fa82503a6db08dcf950c5c..f2167064a1029ab95c44e4e530a8186ff4da8eee 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Reviews/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/Reviews/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Content\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Table/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Table/PluginManagerTest.php index b383ee7937e111e38ce5fe6693ef1783926c746d..5bc0c7492ff08c872012f23e39210f5d1a9bc203 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Table/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Table/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Db\Table\Gateway */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/Driver/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/Driver/PluginManagerTest.php index 5f43b597ff3cb615abb12ce7b8a21ef5bbf112c8..c2d3ce190438c9d67faef0bf3c9bb04833d23202 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/Driver/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/Driver/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Hierarchy\Driver\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeDataSource/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeDataSource/PluginManagerTest.php index fe4d7644a4f03813f9fc6ab6d14e762c7e25cd66..d41cc732e63a13bb538aae598995d3cf10c15332 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeDataSource/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeDataSource/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Hierarchy\TreeDataSource\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeRenderer/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeRenderer/PluginManagerTest.php index 1d4f86e451182a178ffc0c352e7896c6a9f7bb79..31c8289c99328b378e24ed086495c1204eebc6e6 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeRenderer/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Hierarchy/TreeRenderer/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Hierarchy\TreeRenderer\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PluginManagerTest.php index ca6e2f71dd57b21a96a23ccf745c936cabea72ca..860ae66e03c47eb448bc72e216c396dec77b69a8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\ILS\Driver\DriverInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php index 748b5ccf99731e4abba7b8c2a124decf2c3b45aa..1172686878ba52ab6bc5097a933389d61f079953 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertFalse($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Recommend\RecommendInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php index 67b76dc7b3f03f115707ef553426906e64817775..98816b310d3fd56e85e606fcb45060e07173b57d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertFalse($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\RecordDriver\AbstractBase */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php index 87b3daaa9e8f6aa4fe9c9c8b512237543ede7027..cf0d8ad0bba467e9296d3afa72bdfc373280a946 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\RecordTab\TabInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php index 688e9cd3f05dc607f65a99e3380c0dbe79b959ca..73354d78e1bef79458102d16c0d0726c8d4e388d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertFalse($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Related\RelatedInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Resolver/Driver/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Resolver/Driver/PluginManagerTest.php index ccdcab2bb285854ca5e208068029784cb492ff20..b3522ae22ae84c53c34562448871fd6a6ff73210 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Resolver/Driver/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Resolver/Driver/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Resolver\Driver\DriverInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/PluginManagerTest.php index c1b2746d9d4643f30158f638fd79091a2b671241..6da876896656a57f240135ed863c76abd34adc5f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Role\PermissionProvider\PermissionProviderInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Options/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Options/PluginManagerTest.php index 0dba14819d2a4a0e8c6c897cf845536360978217..3a0c7547128cefacf76fc28bf065a7cf82108f6a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Options/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Options/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Search\Base\Options */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Params/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Params/PluginManagerTest.php index 8538420fc80d16eb74eadfe2ae87d46a4d4d9148..8ba909ca1fea2478f231f361f70c3f475df622a0 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Params/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Params/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertFalse($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Search\Base\Params */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Results/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Results/PluginManagerTest.php index a40667556671e54cb9f6f20adead8ed9f084be1a..1f079562fd1482d5a8763030d9f82ef0918d7407 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Results/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Results/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertFalse($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Search\Base\Results */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php index d7e248ea241a1d2ec0ecfbeb62be1a49cd12cfa0..dc6dbf04dd146082ef7a8c8fd33180f01cea51df 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php @@ -47,8 +47,10 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase */ public function testShareByDefault() { - $pm = new PluginManager(null); - $this->assertTrue($pm->shareByDefault()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } /** @@ -56,12 +58,14 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase * * @return void * - * @expectedException Zend\ServiceManager\Exception\RuntimeException + * @expectedException Zend\ServiceManager\Exception\InvalidServiceException * @expectedExceptionMessage Plugin ArrayObject does not belong to Zend\Session\SaveHandler\SaveHandlerInterface */ public function testExpectedInterface() { - $pm = new PluginManager(null); - $pm->validatePlugin(new \ArrayObject()); + $pm = new PluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); + $pm->validate(new \ArrayObject()); } } diff --git a/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php b/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php index 6978540a117b4c15a21cdd310e244318a6f91140..029ee3ca46cda85af83f64ef1045104c2896c459 100644 --- a/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php +++ b/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php @@ -78,7 +78,9 @@ class RecordFormatterTest extends \VuFindTest\Unit\TestCase */ protected function getHelperPluginManager() { - $hm = new \Zend\View\HelperPluginManager(); + $hm = new \Zend\View\HelperPluginManager( + $this->createMock('Interop\Container\ContainerInterface') + ); $hm->setService('translate', new \VuFind\View\Helper\Root\Translate()); $mockRecordLink = $this->getMockBuilder('VuFind\View\Helper\Root\RecordLink')