diff --git a/module/VuFind/src/VuFindTest/Unit/DbTestCase.php b/module/VuFind/src/VuFindTest/Unit/DbTestCase.php index db3f090aef8d1a0778e921f156c619ecf5e4756a..c9669be1f7e674e1e68c6ba98ef0439f02155f0a 100644 --- a/module/VuFind/src/VuFindTest/Unit/DbTestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/DbTestCase.php @@ -114,7 +114,7 @@ abstract class DbTestCase extends TestCase $this->addRowManager($sm); $sm->setService( 'Zend\Session\SessionManager', - $this->createMock('Zend\Session\SessionManager') + $this->createMock(\Zend\Session\SessionManager::class) ); // Override the configuration so PostgreSQL tests can work: diff --git a/module/VuFind/src/VuFindTest/Unit/RecommendDeferredTestCase.php b/module/VuFind/src/VuFindTest/Unit/RecommendDeferredTestCase.php index d4c3dda218bbd6729dca9e7fce84ffe07569a005..ba71e8255449055039a6808ef38618db2fdbdb9b 100644 --- a/module/VuFind/src/VuFindTest/Unit/RecommendDeferredTestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/RecommendDeferredTestCase.php @@ -77,7 +77,7 @@ abstract class RecommendDeferredTestCase extends TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -96,7 +96,7 @@ abstract class RecommendDeferredTestCase extends TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/src/VuFindTest/Unit/TestCase.php b/module/VuFind/src/VuFindTest/Unit/TestCase.php index 0b5c6971f72da5b67560db06e984e3ffc0af5245..2a06288c2cf6d118393dc1de7e0a6be837ccabc8 100644 --- a/module/VuFind/src/VuFindTest/Unit/TestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/TestCase.php @@ -186,7 +186,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase new \VuFind\Config\SearchSpecsReader() ); $this->serviceManager->setService( - 'VuFind\Log\Logger', $this->createMock('VuFind\Log\Logger') + 'VuFind\Log\Logger', $this->createMock(\VuFind\Log\Logger::class) ); $this->serviceManager->setService( 'VuFindHttp\HttpService', new \VuFindHttp\HttpService() 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 c84b9aaa92d8c412a18b7b6f61b0908b84104731..d93d89382ee57191922354c4959f20c77074a00f 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ILSTest.php @@ -102,7 +102,7 @@ class ILSTest extends \VuFindTest\Unit\DbTestCase $this->getServiceManager() ); $driverManager->setService('Sample', $driver); - $mockConfigReader = $this->createMock('VuFind\Config\PluginManager'); + $mockConfigReader = $this->createMock(\VuFind\Config\PluginManager::class); $mockConfigReader->expects($this->any())->method('get') ->will($this->returnValue(new \Zend\Config\Config([]))); $auth = new \VuFind\Auth\ILS( @@ -368,7 +368,7 @@ class ILSTest extends \VuFindTest\Unit\DbTestCase */ protected function getMockILSAuthenticator($patron = null) { - $mock = $this->getMockBuilder('VuFind\Auth\ILSAuthenticator') + $mock = $this->getMockBuilder(\VuFind\Auth\ILSAuthenticator::class) ->disableOriginalConstructor() ->setMethods(['storedCatalogLogin']) ->getMock(); diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php index cd5f254522c48c94868385bd8db826a2077ca2ed..d92f1398dcffbefb62e9a5f269b9db8d9306694d 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Auth/ShibbolethTest.php @@ -78,7 +78,7 @@ class ShibbolethTest extends \VuFindTest\Unit\DbTestCase if (null === $config) { $config = $this->getAuthConfig(); } - $obj = new Shibboleth($this->createMock('Zend\Session\ManagerInterface')); + $obj = new Shibboleth($this->createMock(\Zend\Session\ManagerInterface::class)); $initializer = new \VuFind\ServiceManager\ServiceInitializer(); $initializer($this->getServiceManager(), $obj); $obj->setConfig($config); diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/View/Helper/Root/ResultFeedTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/View/Helper/Root/ResultFeedTest.php index 3fd9b57704155d8c48de8770fa8f90535021a8d5..777d517796bb59036da95206471f98263bbf5085 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/View/Helper/Root/ResultFeedTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/View/Helper/Root/ResultFeedTest.php @@ -60,11 +60,11 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getPlugins() { - $currentPath = $this->createMock('VuFind\View\Helper\Root\CurrentPath'); + $currentPath = $this->createMock(\VuFind\View\Helper\Root\CurrentPath::class); $currentPath->expects($this->any())->method('__invoke') ->will($this->returnValue('/test/path')); - $recordLink = $this->getMockBuilder('VuFind\View\Helper\Root\RecordLink') + $recordLink = $this->getMockBuilder(\VuFind\View\Helper\Root\RecordLink::class) ->setConstructorArgs( [ new \VuFind\Record\Router( @@ -76,7 +76,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase $recordLink->expects($this->any())->method('getUrl') ->will($this->returnValue('test/url')); - $serverUrl = $this->createMock('Zend\View\Helper\ServerUrl'); + $serverUrl = $this->createMock(\Zend\View\Helper\ServerUrl::class); $serverUrl->expects($this->any())->method('__invoke') ->will($this->returnValue('http://server/url')); @@ -94,7 +94,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getMockTranslator() { - $mock = $this->getMockBuilder('Zend\I18n\Translator\TranslatorInterface') + $mock = $this->getMockBuilder(\Zend\I18n\Translator\TranslatorInterface::class) ->getMock(); $mock->expects($this->at(1))->method('translate') ->with($this->equalTo('showing_results_of_html'), $this->equalTo('default')) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ChoiceAuthTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ChoiceAuthTest.php index 38bc7407e14f616ff7fd10f510a45f1f5cc0df62..b38066da576f5fa04cc70dae2f493309e1998519 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ChoiceAuthTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ChoiceAuthTest.php @@ -211,7 +211,7 @@ class ChoiceAuthTest extends \VuFindTest\Unit\TestCase */ protected function getSessionContainer($method = null) { - $mock = $this->getMockBuilder('Zend\Session\Container') + $mock = $this->getMockBuilder(\Zend\Session\Container::class) ->setMethods(['__get', '__isset', '__set', '__unset']) ->disableOriginalConstructor()->getMock(); if ($method) { @@ -248,10 +248,10 @@ class ChoiceAuthTest extends \VuFindTest\Unit\TestCase protected function getMockPluginManager() { $pm = new PluginManager($this->getServiceManager()); - $mockDb = $this->getMockBuilder('VuFind\Auth\Database') + $mockDb = $this->getMockBuilder(\VuFind\Auth\Database::class) ->disableOriginalConstructor() ->getMock(); - $mockShib = $this->getMockBuilder('VuFind\Auth\Shibboleth') + $mockShib = $this->getMockBuilder(\VuFind\Auth\Shibboleth::class) ->disableOriginalConstructor() ->getMock(); $pm->setService('VuFind\Auth\Database', $mockDb); @@ -266,7 +266,7 @@ class ChoiceAuthTest extends \VuFindTest\Unit\TestCase */ protected function getMockUser() { - return $this->getMockBuilder('VuFind\Db\Row\User') + return $this->getMockBuilder(\VuFind\Db\Row\User::class) ->disableOriginalConstructor() ->getMock(); } @@ -278,7 +278,7 @@ class ChoiceAuthTest extends \VuFindTest\Unit\TestCase */ protected function getMockRequest() { - return $this->getMockBuilder('Zend\Http\PhpEnvironment\Request') + return $this->getMockBuilder(\Zend\Http\PhpEnvironment\Request::class) ->disableOriginalConstructor() ->getMock(); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/DatabaseUnitTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/DatabaseUnitTest.php index 3f068b4aaaeab22029c9ae053313ea93c2c307a8..e2d2b85d3f33782e08f2804d3c2e12c209107741 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/DatabaseUnitTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/DatabaseUnitTest.php @@ -195,7 +195,7 @@ class DatabaseUnitTest extends \VuFindTest\Unit\DbTestCase */ protected function getMockRow() { - return $this->getMockBuilder('VuFind\Db\Row\User') + return $this->getMockBuilder(\VuFind\Db\Row\User::class) ->disableOriginalConstructor() ->getMock(); } @@ -210,7 +210,7 @@ class DatabaseUnitTest extends \VuFindTest\Unit\DbTestCase protected function getMockTable($methods = []) { $methods[] = 'getResultSetPrototype'; - $mock = $this->getMockBuilder('VuFind\Db\Table\User') + $mock = $this->getMockBuilder(\VuFind\Db\Table\User::class) ->disableOriginalConstructor() ->setMethods($methods) ->getMock(); @@ -235,7 +235,7 @@ class DatabaseUnitTest extends \VuFindTest\Unit\DbTestCase protected function getRequest($post = []) { $post = new Parameters($post); - $request = $this->getMockBuilder('Zend\Http\PhpEnvironment\Request') + $request = $this->getMockBuilder(\Zend\Http\PhpEnvironment\Request::class) ->setMethods(['getPost'])->getMock(); $request->expects($this->any())->method('getPost') ->will($this->returnValue($post)); @@ -251,7 +251,7 @@ class DatabaseUnitTest extends \VuFindTest\Unit\DbTestCase */ protected function getDatabase($table) { - $tableManager = $this->getMockBuilder('VuFind\Db\Table\PluginManager') + $tableManager = $this->getMockBuilder(\VuFind\Db\Table\PluginManager::class) ->disableOriginalConstructor()->setMethods(['get'])->getMock(); $tableManager->expects($this->once())->method('get') ->with($this->equalTo('User')) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ILSAuthenticatorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ILSAuthenticatorTest.php index ff702404ca47a9c6e7091003a1cb0357974a7f95..77ea52b3e29025f6b9152bd36b2972139b3d5dc7 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ILSAuthenticatorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ILSAuthenticatorTest.php @@ -202,7 +202,7 @@ class ILSAuthenticatorTest extends \VuFindTest\Unit\TestCase */ protected function getMockUser($methods = null) { - return $this->getMockBuilder('VuFind\Db\Row\User') + return $this->getMockBuilder(\VuFind\Db\Row\User::class) ->disableOriginalConstructor() ->setMethods($methods) ->getMock(); @@ -217,7 +217,7 @@ class ILSAuthenticatorTest extends \VuFindTest\Unit\TestCase */ protected function getMockManager($methods = null) { - return $this->getMockBuilder('VuFind\Auth\Manager') + return $this->getMockBuilder(\VuFind\Auth\Manager::class) ->disableOriginalConstructor() ->setMethods($methods) ->getMock(); @@ -232,7 +232,7 @@ class ILSAuthenticatorTest extends \VuFindTest\Unit\TestCase */ protected function getMockConnection($methods = null) { - return $this->getMockBuilder('VuFind\ILS\Connection') + return $this->getMockBuilder(\VuFind\ILS\Connection::class) ->disableOriginalConstructor() ->setMethods($methods) ->getMock(); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php index a27c81cdde738ca7ce5cc7896ee4ef68a1d627a7..167a364a76b01a964a1ac5339571ef324cae812c 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php @@ -86,7 +86,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase // Advanced case -- ChoiceAuth's getSelectableAuthOptions returns false. $pm = $this->getMockPluginManager(); - $mockChoice = $this->getMockBuilder('VuFind\Auth\ChoiceAuth') + $mockChoice = $this->getMockBuilder(\VuFind\Auth\ChoiceAuth::class) ->disableOriginalConstructor() ->getMock(); $mockChoice->expects($this->any())->method('getSelectableAuthOptions')->will($this->returnValue(false)); @@ -481,7 +481,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase $manager = $this->getManager([], $table); // Fake the session inside the manager: - $mockSession = $this->getMockBuilder('Zend\Session\Container') + $mockSession = $this->getMockBuilder(\Zend\Session\Container::class) ->setMethods(['__get', '__isset', '__set', '__unset']) ->disableOriginalConstructor()->getMock(); $mockSession->expects($this->any())->method('__isset')->with($this->equalTo('userId'))->will($this->returnValue(true)); @@ -532,7 +532,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase */ protected function getMockUserTable() { - return $this->getMockBuilder('VuFind\Db\Table\User') + return $this->getMockBuilder(\VuFind\Db\Table\User::class) ->disableOriginalConstructor() ->getMock(); } @@ -544,7 +544,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase */ protected function getMockSessionManager() { - return $this->getMockBuilder('Zend\Session\SessionManager') + return $this->getMockBuilder(\Zend\Session\SessionManager::class) ->disableOriginalConstructor() ->getMock(); } @@ -557,17 +557,17 @@ class ManagerTest extends \VuFindTest\Unit\TestCase protected function getMockPluginManager() { $pm = new PluginManager($this->getServiceManager()); - $mockChoice = $this->getMockBuilder('VuFind\Auth\ChoiceAuth') + $mockChoice = $this->getMockBuilder(\VuFind\Auth\ChoiceAuth::class) ->disableOriginalConstructor() ->getMock(); $mockChoice->expects($this->any())->method('getSelectableAuthOptions')->will($this->returnValue(['Database', 'Shibboleth'])); - $mockDb = $this->getMockBuilder('VuFind\Auth\Database') + $mockDb = $this->getMockBuilder(\VuFind\Auth\Database::class) ->disableOriginalConstructor() ->getMock(); - $mockMulti = $this->getMockBuilder('VuFind\Auth\MultiILS') + $mockMulti = $this->getMockBuilder(\VuFind\Auth\MultiILS::class) ->disableOriginalConstructor() ->getMock(); - $mockShib = $this->getMockBuilder('VuFind\Auth\Shibboleth') + $mockShib = $this->getMockBuilder(\VuFind\Auth\Shibboleth::class) ->disableOriginalConstructor() ->getMock(); $pm->setService('VuFind\Auth\ChoiceAuth', $mockChoice); @@ -584,7 +584,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase */ protected function getMockUser() { - return $this->getMockBuilder('VuFind\Db\Row\User') + return $this->getMockBuilder(\VuFind\Db\Row\User::class) ->disableOriginalConstructor() ->getMock(); } @@ -596,7 +596,7 @@ class ManagerTest extends \VuFindTest\Unit\TestCase */ protected function getMockRequest() { - $mock = $this->getMockBuilder('Zend\Http\PhpEnvironment\Request') + $mock = $this->getMockBuilder(\Zend\Http\PhpEnvironment\Request::class) ->disableOriginalConstructor() ->getMock(); $post = new \Zend\Stdlib\Parameters(); 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 bf05faf91a833320e986af600ffaa48d030ba482..e82670cbf903da9d8e9a0417de7f26bbc0a181ef 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/EdsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/EdsTest.php index 7fc9a56232843a63e0bb9e703c72e00700adf145..8a4d5ed2c0ae9434dbad83208a3372100eb2939b 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/EdsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/EdsTest.php @@ -51,7 +51,7 @@ class EdsTest extends \VuFindTest\Unit\TestCase */ protected function getMockBackend($id = 'EDS') { - return $this->getMockBuilder('VuFindSearch\Backend\EDS\Backend') + return $this->getMockBuilder(\VuFindSearch\Backend\EDS\Backend::class) ->setMethods(['autocomplete']) ->disableOriginalConstructor()->getMock(); } 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 fd435c9047e3a50368acc365b1a2732c01c2c7be..24c3016e8fef315a4e5888d6cf9ab2c5839ea74f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/SolrTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/SolrTest.php index c1e1e54721b92841288b2433c00a752e8dc37c27..935f3b6e1b7cc101ece452988b3f78b8435b49bf 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/SolrTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/SolrTest.php @@ -47,7 +47,7 @@ class SolrTest extends \VuFindTest\Unit\TestCase */ protected function getMockOptions() { - return $this->getMockBuilder('VuFind\Search\Solr\Options') + return $this->getMockBuilder(\VuFind\Search\Solr\Options::class) ->disableOriginalConstructor()->getMock(); } @@ -58,7 +58,7 @@ class SolrTest extends \VuFindTest\Unit\TestCase */ protected function getMockResults() { - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor() ->setMethods(['getOptions']) ->getMock(); @@ -74,7 +74,7 @@ class SolrTest extends \VuFindTest\Unit\TestCase */ protected function getMockResultsPluginManager() { - $rpm = $this->getMockBuilder('VuFind\Search\Results\PluginManager') + $rpm = $this->getMockBuilder(\VuFind\Search\Results\PluginManager::class) ->disableOriginalConstructor() ->setMethods(['get']) ->getMock(); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/TagTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/TagTest.php index 1b0080a408d0bdf4537ad213bfdfa07601050f6a..00dcc4af575be984645a96ec01e824c098d3dfd8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/TagTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Autocomplete/TagTest.php @@ -68,12 +68,12 @@ class TagTest extends \VuFindTest\Unit\DbTestCase ]; // Fake services: - $tagTable = $this->getMockBuilder('VuFind\Db\Table\Tags') + $tagTable = $this->getMockBuilder(\VuFind\Db\Table\Tags::class) ->disableOriginalConstructor()->setMethods(['matchText'])->getMock(); $tagTable->expects($this->once())->method('matchText') ->with($this->equalTo('foo')) ->will($this->returnValue($tags)); - $tableManager = $this->getMockBuilder('VuFind\Db\Table\PluginManager') + $tableManager = $this->getMockBuilder(\VuFind\Db\Table\PluginManager::class) ->disableOriginalConstructor()->setMethods(['get'])->getMock(); $tableManager->expects($this->once())->method('get') ->with($this->equalTo('Tags')) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/CartTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/CartTest.php index c5f3c76b752eeacfd9bb5bf27593e7a5f5755e74..756a517751c1b744d9f4575bf51cff8d10ba00df 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/CartTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/CartTest.php @@ -54,11 +54,11 @@ class CartTest extends \PHPUnit\Framework\TestCase */ public function setUp() { - $this->loader = $this->getMockBuilder('VuFind\Record\Loader') + $this->loader = $this->getMockBuilder(\VuFind\Record\Loader::class) ->setMethods([]) ->setConstructorArgs([ - $this->createMock('VuFindSearch\Service'), - $this->createMock('VuFind\RecordDriver\PluginManager') + $this->createMock(\VuFindSearch\Service::class), + $this->createMock(\VuFind\RecordDriver\PluginManager::class) ])->getMock(); } @@ -75,7 +75,7 @@ class CartTest extends \PHPUnit\Framework\TestCase protected function getMockCookieManager($cookies = [], $path = '/', $domain = null, $secure = false, $httpOnly = false ) { - return $this->getMockBuilder('VuFind\Cookie\CookieManager') + return $this->getMockBuilder(\VuFind\Cookie\CookieManager::class) ->setMethods(['set']) ->setConstructorArgs([$cookies, $path, $domain, $secure, $httpOnly]) ->getMock(); 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 277f8fb3e4ce54b528513a7afe6a3f9a3f161b00..0c5250109b3ef9a1869c12cae98634e37ec2566a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/PluginFactoryTest.php @@ -135,7 +135,7 @@ class PluginFactoryTest extends \VuFindTest\Unit\TestCase protected function getConfig($name) { return $this->factory->__invoke( - $this->createMock('Interop\Container\ContainerInterface'), $name + $this->createMock(\Interop\Container\ContainerInterface::class), $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 1ec05109fdcc56c80e2685c1b725ce2995d866d8..42fcd571553f420cc2d8b47b2d035e81930136f2 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 b077ebb050e9654d3580a8fd2edf3f72390a488c..1fa58849f1030619d36d907cc662ef99ead7c080 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 92f73643e687a4f80b1b8a241c4b62274714e798..3472a32850a73a320e636bca90d0effdbf3fbcd9 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 1d44017a85e7aafc4d0b0f37179141750aaad876..8d42bbe68dfa0da7bdf355b83735c5bc058c8e80 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Content/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 9784550a2237db3a86e7d58182d555e3536cc1eb..7bd4ea03659f0b4ec2bcacbfec4542caebcb3373 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/FollowupTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/FollowupTest.php index 7ee166d6df4a8b0c6627f11e43bfe2809aaa8e83..42183d039d520f9698c3b7f358668d6f36e6201d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/FollowupTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/FollowupTest.php @@ -100,7 +100,7 @@ class FollowupTest extends TestCase */ protected function getMockController($url = 'http://localhost/default-url') { - $controller = $this->getMockBuilder('VuFind\Controller\AbstractBase') + $controller = $this->getMockBuilder(\VuFind\Controller\AbstractBase::class) ->disableOriginalConstructor()->getMock(); $controller->expects($this->any())->method('getServerUrl')->will($this->returnValue($url)); return $controller; diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php index 215a23b2b7d97430d27c905492e940a01966e7e4..e37f439bb0cac43ded1f3ffce828132ddbe8decb 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/NewItemsTest.php @@ -50,7 +50,7 @@ class NewItemsTest extends TestCase */ public function testGetBibIDsFromCatalog() { - $flash = $this->createMock('Zend\Mvc\Plugin\FlashMessenger\FlashMessenger'); + $flash = $this->createMock(\Zend\Mvc\Plugin\FlashMessenger\FlashMessenger::class); $config = new Config(['result_pages' => 10]); $newItems = new NewItems($config); $bibs = $newItems->getBibIDsFromCatalog( @@ -66,7 +66,7 @@ class NewItemsTest extends TestCase */ public function testGetBibIDsFromCatalogWithIDLimit() { - $flash = $this->createMock('Zend\Mvc\Plugin\FlashMessenger\FlashMessenger'); + $flash = $this->createMock(\Zend\Mvc\Plugin\FlashMessenger\FlashMessenger::class); $flash->expects($this->once())->method('addMessage') ->with($this->equalTo('too_many_new_items'), $this->equalTo('info')); $config = new Config(['result_pages' => 10]); @@ -92,7 +92,7 @@ class NewItemsTest extends TestCase ->with($this->equalTo('getFunds'))->will($this->returnValue(true)); $catalog->expects($this->once())->method('getFunds') ->will($this->returnValue(['a', 'b', 'c'])); - $controller = $this->getMockBuilder('VuFind\Controller\SearchController') + $controller = $this->getMockBuilder(\VuFind\Controller\SearchController::class) ->disableOriginalConstructor()->getMock(); $controller->expects($this->once())->method('getILS') ->will($this->returnValue($catalog)); @@ -235,7 +235,7 @@ class NewItemsTest extends TestCase */ protected function getMockParams($idLimit = 1024) { - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->once())->method('getLimit') ->will($this->returnValue(20)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/ResultScrollerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/ResultScrollerTest.php index ca66e6141c711db4b1084c71f80db7d626371972..6810ebaf9a659f7763b557bdf30d37657429eaba 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/ResultScrollerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Controller/Plugin/ResultScrollerTest.php @@ -73,7 +73,7 @@ class ResultScrollerTest extends TestCase */ public function testDisabled() { - $mockManager = $this->getMockBuilder('VuFind\Search\Results\PluginManager') + $mockManager = $this->getMockBuilder(\VuFind\Search\Results\PluginManager::class) ->disableOriginalConstructor()->getMock(); $plugin = new ResultScroller(new Container('test'), $mockManager, false); $results = $this->getMockResults(); @@ -349,7 +349,7 @@ class ResultScrollerTest extends TestCase protected function getMockResults($page = 1, $limit = 20, $total = 0, $firstLast = true, $sort = null ) { - $pm = $this->getMockBuilder('VuFind\Config\PluginManager')->disableOriginalConstructor()->getMock(); + $pm = $this->getMockBuilder(\VuFind\Config\PluginManager::class)->disableOriginalConstructor()->getMock(); $config = new \Zend\Config\Config( $firstLast ? $this->getFirstLastConfig() : [] ); @@ -361,9 +361,9 @@ class ResultScrollerTest extends TestCase if (null !== $sort) { $params->setSort($sort, true); } - $ss = $this->getMockBuilder('VuFindSearch\Service') + $ss = $this->getMockBuilder(\VuFindSearch\Service::class) ->disableOriginalConstructor()->getMock(); - $rl = $this->getMockBuilder('VuFind\Record\Loader') + $rl = $this->getMockBuilder(\VuFind\Record\Loader::class) ->disableOriginalConstructor()->getMock(); $results = new \VuFindTest\Search\TestHarness\Results( $params, $ss, $rl, $total @@ -382,7 +382,7 @@ class ResultScrollerTest extends TestCase */ protected function getMockResultScroller($results) { - $mockManager = $this->getMockBuilder('VuFind\Search\Results\PluginManager') + $mockManager = $this->getMockBuilder(\VuFind\Search\Results\PluginManager::class) ->disableOriginalConstructor()->getMock(); return new ResultScrollerMock($mockManager, $results); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Cover/LoaderTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Cover/LoaderTest.php index c93f7c84d03166ca670de56fa40bcb855b74b2e6..163f17835e36c395c7bdf24406ac21facddef1ee 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Cover/LoaderTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Cover/LoaderTest.php @@ -59,7 +59,7 @@ class LoaderTest extends \VuFindTest\Unit\TestCase */ public function testUtterFailure() { - $theme = $this->getMockBuilder('VuFindTheme\ThemeInfo') + $theme = $this->getMockBuilder(\VuFindTheme\ThemeInfo::class) ->setConstructorArgs(['foo', 'bar'])->getMock(); $theme->expects($this->once())->method('findContainingTheme')->with($this->equalTo(['images/noCover2.gif']))->will($this->returnValue(false)); $loader = $this->getLoader([], null, $theme); @@ -142,13 +142,13 @@ class LoaderTest extends \VuFindTest\Unit\TestCase { $config = new Config($config); if (null === $manager) { - $manager = $this->createMock('VuFind\Content\Covers\PluginManager'); + $manager = $this->createMock(\VuFind\Content\Covers\PluginManager::class); } if (null === $theme) { $theme = new ThemeInfo($this->getThemeDir(), $this->testTheme); } if (null === $httpService) { - $httpService = $this->getMockBuilder('VuFindHttp\HttpService')->getMock(); + $httpService = $this->getMockBuilder(\VuFindHttp\HttpService::class)->getMock(); } if ($mock) { return $this->getMockBuilder(__NAMESPACE__ . '\MockLoader') 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 dc5b4e12575be21f19d9c2ebfa5ee3aad3387f90..529a1781056b6dfd68ac2f70d875eb2300f5dd7f 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 697e2a2acc69977be3015e133a1ea0bbb089303a..c107beec8677a662ecedba35175362cac7348830 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 5389a660b5f7df6e5030f318e1363d14d9244951..49bd6222b0d609f4a7d58e659b5a8dec99f66f9b 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 425ce89c9a95577a47088196d90ac338110b8830..d9d9db51281da279ab9fe81bc068c49071f4aa47 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/DemoTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/DemoTest.php index 62b14e0da16d740023b945e69b06466adaadc4c0..9f94c7867a817af1a2c0ee28219fe981082e1acf 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/DemoTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/DemoTest.php @@ -54,10 +54,10 @@ class DemoTest extends \VuFindTest\Unit\TestCase */ public function setUp() { - $session = $this->getMockBuilder('Zend\Session\Container') + $session = $this->getMockBuilder(\Zend\Session\Container::class) ->disableOriginalConstructor()->getMock(); $this->driver = new Demo( - new \VuFind\Date\Converter(), $this->createMock('VuFindSearch\Service'), + new \VuFind\Date\Converter(), $this->createMock(\VuFindSearch\Service::class), function () use ($session) { return $session; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/MultiBackendTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/MultiBackendTest.php index 2fa754c75815d0a4c502a2ed0b3bd37655d6440b..966ff66f38db63401534bb9e7d7a6281562e2fb0 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/MultiBackendTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/MultiBackendTest.php @@ -84,7 +84,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase $writer = new \Zend\Log\Writer\Mock(); $logger->addWriter($writer); - $mockPM = $this->createMock('\VuFind\Config\PluginManager'); + $mockPM = $this->createMock(\VuFind\Config\PluginManager::class); $mockPM->expects($this->any()) ->method('get') ->will( @@ -202,7 +202,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase $this->assertEquals($configData, $val); $config = new \Zend\Config\Config($configData); - $mockPM = $this->createMock('\VuFind\Config\PluginManager'); + $mockPM = $this->createMock(\VuFind\Config\PluginManager::class); $mockPM->expects($this->any()) ->method('get') ->will( @@ -2220,7 +2220,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase $dummyILS = new DummyILS(); - $sm = $this->getMockBuilder('VuFind\ILS\Driver\PluginManager') + $sm = $this->getMockBuilder(\VuFind\ILS\Driver\PluginManager::class) ->disableOriginalConstructor()->getMock(); $sm->expects($this->any()) ->method('get') @@ -2282,7 +2282,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase */ protected function getMockILSAuthenticator($userSource = '') { - $mockAuth = $this->getMockBuilder('VuFind\Auth\ILSAuthenticator') + $mockAuth = $this->getMockBuilder(\VuFind\Auth\ILSAuthenticator::class) ->disableOriginalConstructor() ->getMock(); if ($userSource) { @@ -2309,7 +2309,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase { $configData = ['config' => 'values']; $config = new \Zend\Config\Config($configData); - $mockPM = $this->createMock('\VuFind\Config\PluginManager'); + $mockPM = $this->createMock(\VuFind\Config\PluginManager::class); $mockPM->expects($this->any()) ->method('get') ->will($this->returnValue($config)); @@ -2352,7 +2352,7 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase */ protected function getMockSM($times = null, $driver = 'Voyager', $return = null) { - $sm = $this->getMockBuilder('VuFind\ILS\Driver\PluginManager') + $sm = $this->getMockBuilder(\VuFind\ILS\Driver\PluginManager::class) ->disableOriginalConstructor()->getMock(); $sm->expects($times === null ? $this->any() : $times) ->method('get') @@ -2368,14 +2368,14 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase */ protected function getMockDemoDriver($methods) { - $session = $this->getMockBuilder('Zend\Session\Container') + $session = $this->getMockBuilder(\Zend\Session\Container::class) ->disableOriginalConstructor()->getMock(); return $this->getMockBuilder(__NAMESPACE__ . '\DemoMock') ->setMethods($methods) ->setConstructorArgs( [ new \VuFind\Date\Converter(), - $this->createMock('VuFindSearch\Service'), + $this->createMock(\VuFindSearch\Service::class), function () use ($session) { return $session; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/NoILSTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/NoILSTest.php index 510f548ca8376c90dff07fa07939addee60533db..0e36604525e0873839bdce9b57237ed0a419ede8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/NoILSTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/NoILSTest.php @@ -61,11 +61,11 @@ class NoILSTest extends \VuFindTest\Unit\TestCase */ public function setUp() { - $this->loader = $this->getMockBuilder('VuFind\Record\Loader') + $this->loader = $this->getMockBuilder(\VuFind\Record\Loader::class) ->setConstructorArgs( [ - $this->createMock('VuFindSearch\Service'), - $this->createMock('VuFind\RecordDriver\PluginManager') + $this->createMock(\VuFindSearch\Service::class), + $this->createMock(\VuFind\RecordDriver\PluginManager::class) ] )->getMock(); $this->driver = new NoILS($this->loader); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PAIATest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PAIATest.php index e4ad2042867f40ba7417253958ed4b7234684a4a..611f8728e162a3f72b37c99831492b2a34b07fa7 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PAIATest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/PAIATest.php @@ -616,7 +616,7 @@ class PAIATest extends \VuFindTest\Unit\ILSDriverTestCase } $service = new \VuFindHttp\HttpService(); $service->setDefaultAdapter($adapter); - $conn = $this->getMockBuilder('VuFind\ILS\Driver\PAIA') + $conn = $this->getMockBuilder(\VuFind\ILS\Driver\PAIA::class) ->setConstructorArgs([ new \VuFind\Date\Converter(), new \Zend\Session\SessionManager() ]) 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 5dd4651532613545fc8f93220b739e0fc9e8b329..41b9397c0c8db1f0b2b1b7fc031191f3c00a178a 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/SymphonyTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/SymphonyTest.php index 5ffbe0d459a8d119018001d73a1e3220074c06c8..88434bb9ce9b1bb90aa6c51bea172cd0ada3fb98 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/SymphonyTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/SymphonyTest.php @@ -54,7 +54,7 @@ class SymphonyTest extends \VuFindTest\Unit\TestCase */ public function setUp() { - $loader = $this->getMockBuilder('VuFind\Record\Loader') + $loader = $this->getMockBuilder(\VuFind\Record\Loader::class) ->disableOriginalConstructor()->getMock(); $this->driver = new Symphony($loader); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Log/LoggerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Log/LoggerTest.php index 1b96dd4f93256c9c7aa6c01fb502d99cda03dc0e..2662a8b5707d2f8a0ee41854b0e3949842113929 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Log/LoggerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Log/LoggerTest.php @@ -78,7 +78,7 @@ CONTEXT; && false !== strpos($a[5], 'function =') && count($a) == 5; }; - $logger = $this->getMockBuilder('VuFind\Log\Logger') + $logger = $this->getMockBuilder(\VuFind\Log\Logger::class) ->setMethods(['log']) ->getMock(); $logger->expects($this->once())->method('log')->with($this->equalTo(Logger::CRIT), $this->callback($callback)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Mailer/MailerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Mailer/MailerTest.php index e61579f131c3b6b226c0c38b2561d558c8c88f83..fc07636a14d35f2b787c851b27a632440e508caa 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Mailer/MailerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Mailer/MailerTest.php @@ -55,7 +55,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'subject' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $mailer = new Mailer($transport); $mailer->send('to@example.com', 'from@example.com', 'subject', 'body'); @@ -75,7 +75,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'subject' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $address = new Address('from@example.com', 'Sender TextName'); $mailer = new Mailer($transport); @@ -96,7 +96,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'subject' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $address = new Address('to@example.com', 'Recipient TextName'); $mailer = new Mailer($transport); @@ -117,7 +117,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'subject' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $list = new AddressList(); $list->add(new Address('to@example.com', 'Recipient TextName')); @@ -140,7 +140,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'subject' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $address = new Address('me@example.com'); $mailer = new Mailer($transport); @@ -158,7 +158,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testBadTo() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send('bad@bad', 'from@example.com', 'subject', 'body'); } @@ -173,7 +173,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testBadReplyTo() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send( 'good@good.com', 'from@example.com', 'subject', 'body', null, 'bad@bad' @@ -190,7 +190,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testEmptyTo() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send('', 'from@example.com', 'subject', 'body'); } @@ -205,7 +205,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testTooManyRecipients() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send('one@test.com;two@test.com', 'from@example.com', 'subject', 'body'); } @@ -220,7 +220,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testBadFrom() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send('to@example.com', 'bad@bad', 'subject', 'body'); } @@ -235,7 +235,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testBadFromInAddressObject() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $mailer = new Mailer($transport); $mailer->send('to@example.com', new Address('bad@bad'), 'subject', 'body'); } @@ -250,7 +250,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testTransportException() { - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->will($this->throwException(new \Exception('Boom'))); $mailer = new Mailer($transport); $mailer->send('to@example.com', 'from@example.com', 'subject', 'body'); @@ -285,7 +285,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'Library Catalog Search Result' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $mailer = new Mailer($transport); $mailer->setMaxRecipients(2); @@ -302,7 +302,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase */ public function testSendRecord() { - $driver = $this->createMock('VuFind\RecordDriver\AbstractBase'); + $driver = $this->createMock(\VuFind\RecordDriver\AbstractBase::class); $driver->expects($this->once())->method('getBreadcrumb')->will($this->returnValue('breadcrumb')); $viewCallback = function ($in) use ($driver) { @@ -323,7 +323,7 @@ class MailerTest extends \VuFindTest\Unit\TestCase && 'body' == $message->getBody() && 'Library Catalog Record: breadcrumb' == $message->getSubject(); }; - $transport = $this->createMock('Zend\Mail\Transport\TransportInterface'); + $transport = $this->createMock(\Zend\Mail\Transport\TransportInterface::class); $transport->expects($this->once())->method('send')->with($this->callback($callback)); $mailer = new Mailer($transport); $mailer->sendRecord('to@example.com', 'from@example.com', 'message', $driver, $view); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/OAI/ServerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/OAI/ServerTest.php index f575bdb8c4badd85a14df38525db412a15865b61..03192ed6a1d409730dce55a8d79a1ef78ca413d3 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/OAI/ServerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/OAI/ServerTest.php @@ -89,7 +89,7 @@ class ServerTest extends \VuFindTest\Unit\TestCase */ protected function getMockResultsManager() { - return $this->getMockBuilder('VuFind\Search\Results\PluginManager') + return $this->getMockBuilder(\VuFind\Search\Results\PluginManager::class) ->disableOriginalConstructor() ->getMock(); } @@ -101,7 +101,7 @@ class ServerTest extends \VuFindTest\Unit\TestCase */ protected function getMockRecordLoader() { - return $this->getMockBuilder('VuFind\Record\Loader') + return $this->getMockBuilder(\VuFind\Record\Loader::class) ->disableOriginalConstructor() ->getMock(); } @@ -113,7 +113,7 @@ class ServerTest extends \VuFindTest\Unit\TestCase */ protected function getMockTableManager() { - return $this->getMockBuilder('VuFind\Db\Table\PluginManager') + return $this->getMockBuilder(\VuFind\Db\Table\PluginManager::class) ->disableOriginalConstructor() ->getMock(); } @@ -125,7 +125,7 @@ class ServerTest extends \VuFindTest\Unit\TestCase */ protected function getMockRecordFormatter() { - return $this->getMockBuilder('VuFindApi\Formatter\RecordFormatter') + return $this->getMockBuilder(\VuFindApi\Formatter\RecordFormatter::class) ->disableOriginalConstructor() ->getMock(); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/QRCode/LoaderTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/QRCode/LoaderTest.php index c7f5e3113a17f7470eefe6dd7b452fcff5ba0b45..6277b28eb2d0c66c06f40181341773ad285b22f9 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/QRCode/LoaderTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/QRCode/LoaderTest.php @@ -59,7 +59,7 @@ class LoaderTest extends \VuFindTest\Unit\TestCase */ public function testUtterFailure() { - $theme = $this->getMockBuilder('VuFindTheme\ThemeInfo') + $theme = $this->getMockBuilder(\VuFindTheme\ThemeInfo::class) ->setConstructorArgs(['foo', 'bar'])->getMock(); $theme->expects($this->once())->method('findContainingTheme')->with($this->equalTo(['images/noQRCode.gif']))->will($this->returnValue(false)); $loader = $this->getLoader([], $theme); @@ -95,7 +95,7 @@ class LoaderTest extends \VuFindTest\Unit\TestCase $theme = new ThemeInfo($this->getThemeDir(), $this->testTheme); } if ($mock) { - return $this->getMockBuilder('VuFind\QRCode\Loader') + return $this->getMockBuilder(\VuFind\QRCode\Loader::class) ->setMethods($mock) ->setConstructorArgs([$config, $theme]) ->getMock(); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/CollectionSideFacetsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/CollectionSideFacetsTest.php index 4d0644325249ea12b7a3081f6e1d46f0a7d5498c..5e11d90f71c24f749262c01abe0343787dbf3fd2 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/CollectionSideFacetsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/CollectionSideFacetsTest.php @@ -96,7 +96,7 @@ class CollectionSideFacetsTest extends \VuFindTest\Unit\TestCase */ protected function getMockConfigLoader($config = [], $key = 'facets') { - $loader = $this->getMockBuilder('VuFind\Config\PluginManager') + $loader = $this->getMockBuilder(\VuFind\Config\PluginManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->once())->method('get')->with($this->equalTo($key)) ->will($this->returnValue(new \Zend\Config\Config($config))); @@ -115,7 +115,7 @@ class CollectionSideFacetsTest extends \VuFindTest\Unit\TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -134,7 +134,7 @@ class CollectionSideFacetsTest extends \VuFindTest\Unit\TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/EuropeanaResultsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/EuropeanaResultsTest.php index c62f2368b266cc4b21863f1d070b55758b3c1837..851ed35cc20f5947b1a1f76797ec05986e2c425e 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/EuropeanaResultsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/EuropeanaResultsTest.php @@ -140,7 +140,7 @@ class EuropeanaResultsTest extends TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -159,7 +159,7 @@ class EuropeanaResultsTest extends TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ExpandFacetsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ExpandFacetsTest.php index 738dfcdf999c03a1a74d0329d7fb9271f5bd47a4..f0cb075ee5ef9979172181ceeda527e2c614fa8d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ExpandFacetsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ExpandFacetsTest.php @@ -116,7 +116,7 @@ class ExpandFacetsTest extends \VuFindTest\Unit\TestCase */ protected function getMockConfigLoader($config = [], $key = 'facets') { - $loader = $this->getMockBuilder('VuFind\Config\PluginManager') + $loader = $this->getMockBuilder(\VuFind\Config\PluginManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->once())->method('get')->with($this->equalTo($key)) ->will($this->returnValue(new \Zend\Config\Config($config))); @@ -135,7 +135,7 @@ class ExpandFacetsTest extends \VuFindTest\Unit\TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -154,7 +154,7 @@ class ExpandFacetsTest extends \VuFindTest\Unit\TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FacetCloudTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FacetCloudTest.php index 2999bbd7c80b5cc1a9390527aa0d711edf9e9f26..8b8fe791c780f58958f3890e84c4843c5a13bd4a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FacetCloudTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FacetCloudTest.php @@ -96,7 +96,7 @@ class FacetCloudTest extends \VuFindTest\Unit\TestCase */ protected function getMockConfigLoader($config = [], $key = 'facets') { - $loader = $this->getMockBuilder('VuFind\Config\PluginManager') + $loader = $this->getMockBuilder(\VuFind\Config\PluginManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->once())->method('get')->with($this->equalTo($key)) ->will($this->returnValue(new \Zend\Config\Config($config))); @@ -115,7 +115,7 @@ class FacetCloudTest extends \VuFindTest\Unit\TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -134,7 +134,7 @@ class FacetCloudTest extends \VuFindTest\Unit\TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FavoriteFacetsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FavoriteFacetsTest.php index 526ef0baf8a1a79c5de805bd9114875989f3fcc5..6e3e95391f3f1442b8aed6fc0310cb9aad1e0468 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FavoriteFacetsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/FavoriteFacetsTest.php @@ -109,7 +109,7 @@ class FavoriteFacetsTest extends \VuFindTest\Unit\TestCase */ protected function getMockConfigLoader($config = [], $key = 'config') { - $loader = $this->getMockBuilder('VuFind\Config\PluginManager') + $loader = $this->getMockBuilder(\VuFind\Config\PluginManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->any())->method('get')->with($this->equalTo($key)) ->will($this->returnValue(new \Zend\Config\Config($config))); @@ -128,7 +128,7 @@ class FavoriteFacetsTest extends \VuFindTest\Unit\TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -147,7 +147,7 @@ class FavoriteFacetsTest extends \VuFindTest\Unit\TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); 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 3c652a665d8a1bca92d0dfb441739e929c1b2e15..f6113819add427f16966aa3acc240a489f69da82 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/RandomRecommendTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/RandomRecommendTest.php index 9b59f2a4297daa60b4a2965ac6f5af28982a20d2..c114544a7cc9b5a50c80ffe29a8d0a460f1895f7 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/RandomRecommendTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/RandomRecommendTest.php @@ -51,8 +51,8 @@ class RandomRecommendTest extends TestCase public function setup() { $this->recommend = new Random( - $this->createMock('VuFindSearch\Service'), - $this->createMock('VuFind\Search\Params\PluginManager') + $this->createMock(\VuFindSearch\Service::class), + $this->createMock(\VuFind\Search\Params\PluginManager::class) ); } @@ -123,8 +123,8 @@ class RandomRecommendTest extends TestCase */ public function testCanInitialise() { - $service = $this->createMock('VuFindSearch\Service'); - $paramManager = $this->createMock('VuFind\Search\Params\PluginManager'); + $service = $this->createMock(\VuFindSearch\Service::class); + $paramManager = $this->createMock(\VuFind\Search\Params\PluginManager::class); $recommend = new Random($service, $paramManager); // Use Solr since some Base components are abstract: @@ -132,14 +132,14 @@ class RandomRecommendTest extends TestCase ->get(\VuFind\Search\Params\PluginManager::class)->get('Solr'); $query = $this->getFixture('query'); $params->setBasicSearch($query->getString(), $query->getHandler()); - $request = $this->createMock('\Zend\StdLib\Parameters'); + $request = $this->createMock(\Zend\StdLib\Parameters::class); $service->expects($this->once())->method('random') ->with( $this->equalTo("Solr"), $this->equalTo($params->getQuery()), $this->equalTo(10) - )->will($this->returnValue($this->createMock('VuFindSearch\Response\RecordCollectionInterface'))); + )->will($this->returnValue($this->createMock(\VuFindSearch\Response\RecordCollectionInterface::class))); $recommend->setConfig("Solr:10:mixed:retain:20:facet1:value1:facet2:value2"); $recommend->init($params, $request); @@ -152,8 +152,8 @@ class RandomRecommendTest extends TestCase */ public function testCanInitialiseInDisregardMode() { - $service = $this->createMock('VuFindSearch\Service'); - $paramManager = $this->createMock('VuFind\Search\Params\PluginManager'); + $service = $this->createMock(\VuFindSearch\Service::class); + $paramManager = $this->createMock(\VuFind\Search\Params\PluginManager::class); $recommend = new Random($service, $paramManager); $paramManager->expects($this->once())->method('get') @@ -170,11 +170,11 @@ class RandomRecommendTest extends TestCase ->get(\VuFind\Search\Params\PluginManager::class)->get('Solr'); $query = $this->getFixture('query'); $params->setBasicSearch($query->getString(), $query->getHandler()); - $request = $this->createMock('\Zend\StdLib\Parameters'); + $request = $this->createMock(\Zend\StdLib\Parameters::class); $service->expects($this->once())->method('random') ->with($this->equalTo("Solr")) - ->will($this->returnValue($this->createMock('VuFindSearch\Response\RecordCollectionInterface'))); + ->will($this->returnValue($this->createMock(\VuFindSearch\Response\RecordCollectionInterface::class))); $recommend->setConfig("Solr:10:mixed:disregard:20:facet1:value1:facet2:value2"); $recommend->init($params, $request); @@ -187,8 +187,8 @@ class RandomRecommendTest extends TestCase */ public function testWillReturnEmptyForMinimumResultLimit() { - $service = $this->createMock('VuFindSearch\Service'); - $paramManager = $this->createMock('VuFind\Search\Params\PluginManager'); + $service = $this->createMock(\VuFindSearch\Service::class); + $paramManager = $this->createMock(\VuFind\Search\Params\PluginManager::class); $recommend = new Random($service, $paramManager); $records = ["1", "2", "3", "4", "5"]; @@ -198,9 +198,9 @@ class RandomRecommendTest extends TestCase $params = $results->getParams(); $query = $this->getFixture('query'); $params->setBasicSearch($query->getString(), $query->getHandler()); - $request = $this->createMock('\Zend\StdLib\Parameters'); + $request = $this->createMock(\Zend\StdLib\Parameters::class); - $results = $this->createMock('VuFindSearch\Response\RecordCollectionInterface'); + $results = $this->createMock(\VuFindSearch\Response\RecordCollectionInterface::class); $results->expects($this->once())->method('getRecords') ->will($this->returnValue($records)); @@ -225,8 +225,8 @@ class RandomRecommendTest extends TestCase */ public function testWillReturnResults() { - $service = $this->createMock('VuFindSearch\Service'); - $paramManager = $this->createMock('VuFind\Search\Params\PluginManager'); + $service = $this->createMock(\VuFindSearch\Service::class); + $paramManager = $this->createMock(\VuFind\Search\Params\PluginManager::class); $recommend = new Random($service, $paramManager); $records = ["1", "2", "3", "4", "5"]; @@ -236,9 +236,9 @@ class RandomRecommendTest extends TestCase $params = $results->getParams(); $query = $this->getFixture('query'); $params->setBasicSearch($query->getString(), $query->getHandler()); - $request = $this->createMock('\Zend\StdLib\Parameters'); + $request = $this->createMock(\Zend\StdLib\Parameters::class); - $results = $this->createMock('VuFindSearch\Response\RecordCollectionInterface'); + $results = $this->createMock(\VuFindSearch\Response\RecordCollectionInterface::class); $results->expects($this->once())->method('getRecords') ->will($this->returnValue($records)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SideFacetsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SideFacetsTest.php index 8fe36e25349108d490710f84469041f89fb67ced..f7dfcd73fa5b6f661ab315044c9f4211d5628e5f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SideFacetsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SideFacetsTest.php @@ -326,7 +326,7 @@ class SideFacetsTest extends \VuFindTest\Unit\TestCase */ protected function getMockConfigLoader($config = [], $key = 'facets') { - $loader = $this->getMockBuilder('VuFind\Config\PluginManager') + $loader = $this->getMockBuilder(\VuFind\Config\PluginManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->once())->method('get')->with($this->equalTo($key)) ->will($this->returnValue(new \Zend\Config\Config($config))); @@ -345,7 +345,7 @@ class SideFacetsTest extends \VuFindTest\Unit\TestCase if (null === $params) { $params = $this->getMockParams(); } - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -364,7 +364,7 @@ class SideFacetsTest extends \VuFindTest\Unit\TestCase if (null === $query) { $query = new \VuFindSearch\Query\Query('foo', 'bar'); } - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SummonResultsDeferredTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SummonResultsDeferredTest.php index 1b1de8f9cf5ff376a4e18a7a5c55bf5fb40dcfea..fb32c0e55f57624c927a132be05caa4ca55bba81 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SummonResultsDeferredTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SummonResultsDeferredTest.php @@ -47,7 +47,7 @@ class SummonResultsDeferredTest extends \VuFindTest\Unit\RecommendDeferredTestCa { $results = $this->getMockResults(); $params = $results->getParams(); - $options = $this->getMockBuilder('VuFind\Search\Solr\Options') + $options = $this->getMockBuilder(\VuFind\Search\Solr\Options::class) ->disableOriginalConstructor()->getMock(); $options->expects($this->once())->method('getLabelForBasicHandler')->with($this->equalTo('bar'))->will($this->returnValue('baz')); $params->expects($this->once())->method('getOptions')->will($this->returnValue($options)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SwitchQueryTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SwitchQueryTest.php index ac31c69799a0bf57e527a6675d5eae8733ef85da..019657b6f41636714d46a9263810f3953b8859b8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SwitchQueryTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/SwitchQueryTest.php @@ -212,15 +212,15 @@ class SwitchQueryTest extends \VuFindTest\Unit\TestCase protected function getMockBackendManager($csBools = true, $csRanges = true) { $helper = new \VuFindSearch\Backend\Solr\LuceneSyntaxHelper($csBools, $csRanges); - $queryBuilder = $this->getMockBuilder('VuFindSearch\Backend\Solr\QueryBuilder') + $queryBuilder = $this->getMockBuilder(\VuFindSearch\Backend\Solr\QueryBuilder::class) ->disableOriginalConstructor()->getMock(); $queryBuilder->expects($this->any())->method('getLuceneHelper') ->will($this->returnValue($helper)); - $backend = $this->getMockBuilder('VuFindSearch\Backend\Solr\Backend') + $backend = $this->getMockBuilder(\VuFindSearch\Backend\Solr\Backend::class) ->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getQueryBuilder') ->will($this->returnValue($queryBuilder)); - $loader = $this->getMockBuilder('VuFind\Search\BackendManager') + $loader = $this->getMockBuilder(\VuFind\Search\BackendManager::class) ->disableOriginalConstructor()->getMock(); $loader->expects($this->any())->method('get')->with($this->equalTo('Solr')) ->will($this->returnValue($backend)); @@ -238,7 +238,7 @@ class SwitchQueryTest extends \VuFindTest\Unit\TestCase protected function getMockResults($query = '', $type = 'basic') { $params = $this->getMockParams($query, $type); - $results = $this->getMockBuilder('VuFind\Search\Solr\Results') + $results = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $results->expects($this->any())->method('getParams') ->will($this->returnValue($params)); @@ -255,7 +255,7 @@ class SwitchQueryTest extends \VuFindTest\Unit\TestCase */ protected function getMockParams($query = '', $type = 'basic') { - $params = $this->getMockBuilder('VuFind\Search\Solr\Params') + $params = $this->getMockBuilder(\VuFind\Search\Solr\Params::class) ->disableOriginalConstructor()->getMock(); $params->expects($this->any())->method('getDisplayQuery') ->will($this->returnValue($query)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/CacheTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/CacheTest.php index 815f3bf47d778559aea76f08fbd2d874ea65be77..3afbad93a918fed84c0f9b67554ac88b4fdb697c 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/CacheTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/CacheTest.php @@ -257,7 +257,7 @@ class CacheTest extends TestCase return false; }; - $recordTable = $this->getMockBuilder('VuFind\Db\Table\Record') + $recordTable = $this->getMockBuilder(\VuFind\Db\Table\Record::class) ->disableOriginalConstructor()->getMock(); $recordTable->method('findRecords') ->will($this->returnCallback($findRecordsCallback)); @@ -325,7 +325,7 @@ class CacheTest extends TestCase */ protected function getDriver($id = 'test', $source = 'Solr') { - $driver = $this->createMock('VuFind\RecordDriver\AbstractBase'); + $driver = $this->createMock(\VuFind\RecordDriver\AbstractBase::class); $driver->expects($this->any()) ->method('getUniqueId') ->will($this->returnValue($id)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/LoaderTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/LoaderTest.php index fa903566315d9fb8c57767fc8372de58a2c9373d..df27423a743f3bbfe49541d26d80e2b047518041 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/LoaderTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/LoaderTest.php @@ -57,7 +57,7 @@ class LoaderTest extends TestCase public function testMissingRecord() { $collection = $this->getCollection([]); - $service = $this->createMock('VuFindSearch\Service'); + $service = $this->createMock(\VuFindSearch\Service::class); $service->expects($this->once())->method('retrieve') ->with($this->equalTo('Solr'), $this->equalTo('test')) ->will($this->returnValue($collection)); @@ -73,12 +73,12 @@ class LoaderTest extends TestCase public function testToleratedMissingRecord() { $collection = $this->getCollection([]); - $service = $this->createMock('VuFindSearch\Service'); + $service = $this->createMock(\VuFindSearch\Service::class); $service->expects($this->once())->method('retrieve') ->with($this->equalTo('Solr'), $this->equalTo('test')) ->will($this->returnValue($collection)); $missing = $this->getDriver('missing', 'Missing'); - $factory = $this->createMock('VuFind\RecordDriver\PluginManager'); + $factory = $this->createMock(\VuFind\RecordDriver\PluginManager::class); $factory->expects($this->once())->method('get') ->with($this->equalTo('Missing')) ->will($this->returnValue($missing)); @@ -96,7 +96,7 @@ class LoaderTest extends TestCase { $driver = $this->getDriver(); $collection = $this->getCollection([$driver]); - $service = $this->createMock('VuFindSearch\Service'); + $service = $this->createMock(\VuFindSearch\Service::class); $service->expects($this->once())->method('retrieve') ->with($this->equalTo('Solr'), $this->equalTo('test')) ->will($this->returnValue($collection)); @@ -120,12 +120,12 @@ class LoaderTest extends TestCase $collection2 = $this->getCollection([$driver3]); $collection3 = $this->getCollection([]); - $factory = $this->createMock('VuFind\RecordDriver\PluginManager'); + $factory = $this->createMock(\VuFind\RecordDriver\PluginManager::class); $factory->expects($this->once())->method('get') ->with($this->equalTo('Missing')) ->will($this->returnValue($missing)); - $service = $this->createMock('VuFindSearch\Service'); + $service = $this->createMock(\VuFindSearch\Service::class); $service->expects($this->at(0))->method('retrieveBatch') ->with($this->equalTo('Solr'), $this->equalTo(['test1', 'test2'])) ->will($this->returnValue($collection1)); @@ -154,7 +154,7 @@ class LoaderTest extends TestCase */ protected function getDriver($id = 'test', $source = 'Solr') { - $driver = $this->createMock('VuFind\RecordDriver\AbstractBase'); + $driver = $this->createMock(\VuFind\RecordDriver\AbstractBase::class); $driver->expects($this->any())->method('getUniqueId') ->will($this->returnValue($id)); $driver->expects($this->any())->method('getSourceIdentifier') @@ -173,7 +173,7 @@ class LoaderTest extends TestCase protected function getLoader(SearchService $service, RecordFactory $factory = null) { if (null === $factory) { - $factory = $this->createMock('VuFind\RecordDriver\PluginManager'); + $factory = $this->createMock(\VuFind\RecordDriver\PluginManager::class); } return new Loader($service, $factory); } @@ -187,7 +187,7 @@ class LoaderTest extends TestCase */ protected function getCollection($records) { - $collection = $this->createMock('VuFindSearch\Response\RecordCollectionInterface'); + $collection = $this->createMock(\VuFindSearch\Response\RecordCollectionInterface::class); $collection->expects($this->any())->method('getRecords')->will($this->returnValue($records)); $collection->expects($this->any())->method('count')->will($this->returnValue(count($records))); return $collection; diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/RouterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/RouterTest.php index 8d52579f18c0455c1275c20e1285e48941ee37ca..be1cc69a68ca5aeec24f8302cd4758ebde17569f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Record/RouterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Record/RouterTest.php @@ -174,7 +174,7 @@ class RouterTest extends TestCase */ protected function getDriver($id = 'test', $source = 'Solr') { - $driver = $this->createMock('VuFind\RecordDriver\AbstractBase'); + $driver = $this->createMock(\VuFind\RecordDriver\AbstractBase::class); $driver->expects($this->any())->method('getUniqueId') ->will($this->returnValue($id)); $driver->expects($this->any())->method('getSourceIdentifier') @@ -195,11 +195,11 @@ class RouterTest extends TestCase if (null === $record) { $record = $this->getDriver(); } - $loader = $this->getMockBuilder('VuFind\Record\Loader') + $loader = $this->getMockBuilder(\VuFind\Record\Loader::class) ->setConstructorArgs( [ - $this->createMock('VuFindSearch\Service'), - $this->createMock('VuFind\RecordDriver\PluginManager') + $this->createMock(\VuFindSearch\Service::class), + $this->createMock(\VuFind\RecordDriver\PluginManager::class) ] )->getMock(); $loader->expects($this->any())->method('load') 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 27e833205ced22be4226e19f1283730bf5aab439..77dd971ab6f69a9f04f6b143bf461dc796ce04c5 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 df6b526337ba404d5bf6285dbafa4931c64a99f6..dfe106bbe6af6f61fbbea19de4ec47a87d278938 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordTab/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 8c15dd964e5aa6e628773729ca1fbc7a7cfa1236..1da043032ecdc53dc9dca5c4e0b4350e95751cec 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/SimilarTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/SimilarTest.php index 2edd9b59ea248e33edc85f9b05f2da9d966e9237..339982f197ff49ce7e239e19a912ee9e8f1ab854 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/SimilarTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/SimilarTest.php @@ -49,13 +49,13 @@ class SimilarTest extends \VuFindTest\Unit\TestCase { // Similar is really just a thin wrapper around the search service; make // sure it does its job properly with the help of some mocks. - $driver = $this->getMockBuilder('VuFind\RecordDriver\SolrDefault') + $driver = $this->getMockBuilder(\VuFind\RecordDriver\SolrDefault::class) ->setMethods(['getUniqueId']) ->getMock(); $driver->expects($this->once()) ->method('getUniqueId') ->will($this->returnValue('fakeid')); - $service = $this->getMockBuilder('VuFindSearch\Service') + $service = $this->getMockBuilder(\VuFindSearch\Service::class) ->setMethods(['similar']) ->getMock(); $service->expects($this->once()) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/WorldCatSimilarTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/WorldCatSimilarTest.php index 83ca8b1ec20c00494349aff1d6daf22a51763dae..30d0a350250d663171192cc07c34b1490e522e50 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Related/WorldCatSimilarTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Related/WorldCatSimilarTest.php @@ -48,7 +48,7 @@ class WorldCatSimilarTest extends \VuFindTest\Unit\TestCase */ public function testGetResults() { - $driver = $this->getMockBuilder('VuFind\RecordDriver\WorldCat') + $driver = $this->getMockBuilder(\VuFind\RecordDriver\WorldCat::class) ->setMethods(['tryMethod', 'getPrimaryAuthor', 'getAllSubjectHeadings', 'getTitle', 'getUniqueId', 'getSourceIdentifier']) ->getMock(); $driver->expects($this->once()) @@ -70,10 +70,10 @@ class WorldCatSimilarTest extends \VuFindTest\Unit\TestCase $driver->expects($this->once()) ->method('getSourceIdentifier') ->will($this->returnValue('WorldCat')); - $service = $this->getMockBuilder('VuFindSearch\Service') + $service = $this->getMockBuilder(\VuFindSearch\Service::class) ->setMethods(['search'])->getMock(); $expectedQuery = new Query('(srw.dd any "fakedc" or srw.au all "fakepa" or srw.su all "fakesh1a fakesh1b" or srw.su all "fakesh2" or srw.ti any "faketitle") not srw.no all "fakeid"'); - $response = $this->getMockBuilder('VuFindSearch\Backend\WorldCat\Response\XML\RecordCollection') + $response = $this->getMockBuilder(\VuFindSearch\Backend\WorldCat\Response\XML\RecordCollection::class) ->setMethods(['getRecords']) ->setConstructorArgs([['offset' => 0, 'total' => 0]]) ->getMock(); 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 26d7391bfcc32ce625b4994ef28730465ab41920..44369aced8f110d8f9a9ed6582d3053a86f1ca8c 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/DynamicRoleProviderTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/DynamicRoleProviderTest.php index acaedee09ac977c6397084b8cc0fc8c79114219f..4c1bdbc072286bf475a2f379bdc180caa37d18cf 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/DynamicRoleProviderTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/DynamicRoleProviderTest.php @@ -103,7 +103,7 @@ class DynamicRoleProviderTest extends \VuFindTest\Unit\TestCase { $pm = new PluginManager($this->getServiceManager()); foreach (['a', 'b', 'c'] as $name) { - $pm->setService($name, $this->createMock('VuFind\Role\PermissionProvider\PermissionProviderInterface')); + $pm->setService($name, $this->createMock(\VuFind\Role\PermissionProvider\PermissionProviderInterface::class)); } return $pm; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionManagerTest.php index 64cd58bbf554fdd60814980e7ce460a3774e9d0b..d5845f1b6a74a9ed725cffcda7e049bae583be4b 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionManagerTest.php @@ -103,7 +103,7 @@ class PermissionManagerTest extends \VuFindTest\Unit\TestCase public function testGrantedPermission() { $pm = new PermissionManager($this->permissionConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -121,7 +121,7 @@ class PermissionManagerTest extends \VuFindTest\Unit\TestCase public function testDeniedPermission() { $pm = new PermissionManager($this->permissionConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') 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 7827ba0082c2c61207bbd29ea1d68562e9ca68d5..d56ae165f6bd84201c2f0c4d076e6356afa4b8af 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/UserTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/UserTest.php index d7db63f15b97e423715b7af3b5b98736c7b9060f..077f20fcf34c03a0b7f875f06600976d32177bce 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/UserTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Role/PermissionProvider/UserTest.php @@ -124,7 +124,7 @@ class UserTest extends \VuFindTest\Unit\TestCase protected function getMockAuthorizationService() { $authorizationService - = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $authorizationService @@ -141,7 +141,7 @@ class UserTest extends \VuFindTest\Unit\TestCase */ protected function getMockUser() { - $user = $this->getMockBuilder('VuFind\Db\Row\User') + $user = $this->getMockBuilder(\VuFind\Db\Row\User::class) ->disableOriginalConstructor() ->getMock(); $user->method('__get') diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/SMS/ClickatellTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/SMS/ClickatellTest.php index a6e1eb12ebe61d6f846cbe7e112d3436c04a8991..33febe51c4704bc9932618a511dadd714ed7b422 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/SMS/ClickatellTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/SMS/ClickatellTest.php @@ -195,6 +195,6 @@ class ClickatellTest extends \VuFindTest\Unit\TestCase */ protected function getMockClient() { - return $this->createMock('Zend\Http\Client'); + return $this->createMock(\Zend\Http\Client::class); } } 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 3bca379c3238acdf1eee6b14bd4b1feeb0d8e9b6..4cd57405f2e66bdc908c015a56158d2f40ae3cb6 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $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 152c368493d2da0763f9eba34bf5b9d291cc292c..e4621b55386509e2f3144f04126b535e77a5012b 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/OnCampusListenerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/OnCampusListenerTest.php index 4d4840d1802f51937fa819f1e50bb5cae2048be1..c187af11321bd97e48e6ea3a9942eaad2ea94e0d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/OnCampusListenerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/OnCampusListenerTest.php @@ -73,7 +73,7 @@ class OnCampusListenerTest extends TestCase public function testAttach() { $listener = new InjectOnCampusListener(); - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('pre'), @@ -89,11 +89,11 @@ class OnCampusListenerTest extends TestCase */ public function testAttachWithParameter() { - $mockPermController = $this->getMockBuilder('PrimoPermissionHandler') + $mockPermController = $this->getMockBuilder(\PrimoPermissionHandler::class) ->disableOriginalConstructor() ->getMock(); $listener = new InjectOnCampusListener($mockPermController); - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('pre'), @@ -128,8 +128,8 @@ class OnCampusListenerTest extends TestCase public function testOnCampusDefaultSuccessfull() { $params = new ParamBag([ ]); - $mockPermController - = $this->getMockBuilder('VuFind\Search\Primo\PrimoPermissionHandler') + $mockPermController = $this + ->getMockBuilder(\VuFind\Search\Primo\PrimoPermissionHandler::class) ->disableOriginalConstructor() ->getMock(); $mockPermController->expects($this->any())->method('hasPermission') @@ -156,7 +156,7 @@ class OnCampusListenerTest extends TestCase { $params = new ParamBag([ ]); $mockPermController - = $this->getMockBuilder('VuFind\Search\Primo\PrimoPermissionHandler') + = $this->getMockBuilder(\VuFind\Search\Primo\PrimoPermissionHandler::class) ->disableOriginalConstructor() ->getMock(); @@ -179,7 +179,7 @@ class OnCampusListenerTest extends TestCase { $params = new ParamBag([ ]); $mockPermController - = $this->getMockBuilder('VuFind\Search\Primo\PrimoPermissionHandler') + = $this->getMockBuilder(\VuFind\Search\Primo\PrimoPermissionHandler::class) ->disableOriginalConstructor() ->getMock(); $mockPermController->expects($this->any())->method('hasPermission') @@ -203,8 +203,8 @@ class OnCampusListenerTest extends TestCase public function testOnCampusOutsideNetwork() { $params = new ParamBag([ ]); - $mockPermController - = $this->getMockBuilder('VuFind\Search\Primo\PrimoPermissionHandler') + $mockPermController = $this + ->getMockBuilder(\VuFind\Search\Primo\PrimoPermissionHandler::class) ->disableOriginalConstructor() ->getMock(); $mockPermController->expects($this->any())->method('hasPermission') diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/PrimoPermissionHandlerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/PrimoPermissionHandlerTest.php index 6bc48e2bcf52a94e87478c5d7bb72d6439895470..92cf6336c4c902bffb1fe57ca5286891a77f8388 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/PrimoPermissionHandlerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Primo/PrimoPermissionHandlerTest.php @@ -30,6 +30,7 @@ namespace VuFindTest\Search\Primo; use VuFind\Search\Primo\PrimoPermissionHandler; use VuFindTest\Unit\TestCase; +use ZfcRbac\Service\AuthorizationService; /** * Unit tests for Primo Permission Handler. @@ -182,7 +183,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerCodeSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -203,7 +204,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultCode() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -238,7 +239,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerMemberAuthSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -261,7 +262,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerMemberAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -284,7 +285,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultAuthSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -307,7 +308,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -331,7 +332,7 @@ class PrimoPermissionHandlerTest extends TestCase { $handler = new PrimoPermissionHandler($this->primoConfig); $handler->setInstCode('NOTEXISTING'); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -352,7 +353,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultAuthSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -375,7 +376,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -398,7 +399,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultCodeSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -419,7 +420,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultCodeAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -438,7 +439,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultDefaultAuthSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -461,7 +462,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerWithoutDefaultDefaultAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigWithoutDefault); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -486,7 +487,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnly); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -511,7 +512,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyCodeAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnly); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -534,7 +535,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyDefaultAuthSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnly); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -557,7 +558,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyDefaultAuthNotSuccessfull() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnly); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -582,7 +583,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerMemberIsOnCampusWithDefault() { $handler = new PrimoPermissionHandler($this->primoConfigInstitutionCode); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -609,7 +610,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerMemberIsNotOnCampusWithDefault() { $handler = new PrimoPermissionHandler($this->primoConfigInstitutionCode); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -634,7 +635,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerIsNotAMemberAndNotDefaultOnCampus() { $handler = new PrimoPermissionHandler($this->primoConfigInstitutionCode); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -659,7 +660,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerIsNotAMemberButOnDefaultCampus() { $handler = new PrimoPermissionHandler($this->primoConfigInstitutionCode); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -688,7 +689,7 @@ class PrimoPermissionHandlerTest extends TestCase $handler = new PrimoPermissionHandler( $this->primoConfigWithoutDefaultWithInstCode ); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -716,7 +717,7 @@ class PrimoPermissionHandlerTest extends TestCase $handler = new PrimoPermissionHandler( $this->primoConfigWithoutDefaultWithInstCode ); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -742,7 +743,7 @@ class PrimoPermissionHandlerTest extends TestCase $handler = new PrimoPermissionHandler( $this->primoConfigWithoutDefaultWithInstCode ); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -768,7 +769,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyNoOncampus() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnlyNoOnCampusRule); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -788,7 +789,7 @@ class PrimoPermissionHandlerTest extends TestCase public function testHandlerDefaultOnlyCodeNoOncampus() { $handler = new PrimoPermissionHandler($this->primoConfigDefaultOnlyNoOnCampusRule); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') 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 a68acf7ffce638c3147de38a2f3b75720ad5e8f6..8ab15d6a4ced92eca778f208d1d73ee008d40964 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 @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertFalse($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/SearchTabsHelperTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/SearchTabsHelperTest.php index fe4933a71f68d91f4624d0e5e83e1405e8be0360..1b19096ba3e8dab335c5e62c071c22b45fc47b4d 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/SearchTabsHelperTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/SearchTabsHelperTest.php @@ -208,17 +208,17 @@ class SearchTabsHelperTest extends TestCase protected function getSearchTabsHelper($config = 'default_unfiltered', $filters = null ) { - $mockRequest = $this->createMock('Zend\Http\Request'); + $mockRequest = $this->createMock(\Zend\Http\Request::class); $mockRequest->expects($this->any()) ->method('getQuery') ->with($this->equalTo('hiddenFilters')) ->willReturn($filters); - $configManager = $this->createMock('VuFind\Config\PluginManager'); + $configManager = $this->createMock(\VuFind\Config\PluginManager::class); - $mockSolrOptions = $this->getMockBuilder('VuFind\Search\Solr\Options') + $mockSolrOptions = $this->getMockBuilder(\VuFind\Search\Solr\Options::class) ->disableOriginalConstructor()->getMock(); - $mockSolr = $this->getMockBuilder('VuFind\Search\Solr\Results') + $mockSolr = $this->getMockBuilder(\VuFind\Search\Solr\Results::class) ->disableOriginalConstructor()->getMock(); $mockSolr->expects($this->any()) ->method('getParams') @@ -226,9 +226,9 @@ class SearchTabsHelperTest extends TestCase new \VuFind\Search\Solr\Params($mockSolrOptions, $configManager) ); - $mockPrimoOptions = $this->getMockBuilder('VuFind\Search\Primo\Options') + $mockPrimoOptions = $this->getMockBuilder(\VuFind\Search\Primo\Options::class) ->disableOriginalConstructor()->getMock(); - $mockPrimo = $this->getMockBuilder('VuFind\Search\Primo\Results') + $mockPrimo = $this->getMockBuilder(\VuFind\Search\Primo\Results::class) ->disableOriginalConstructor()->getMock(); $mockPrimo->expects($this->any()) ->method('getParams') @@ -236,7 +236,7 @@ class SearchTabsHelperTest extends TestCase new \VuFind\Search\Primo\Params($mockPrimoOptions, $configManager) ); - $mockResults = $this->createMock('VuFind\Search\Results\PluginManager'); + $mockResults = $this->createMock(\VuFind\Search\Results\PluginManager::class); $mockResults->expects($this->any()) ->method('get') ->will( diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/ConditionalFilterListenerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/ConditionalFilterListenerTest.php index 37c9013d35144c29b9cd167f710a8b0aacc7f8e8..dffe9fe5068ffac755afb5c51ca6e2937a5425bd 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/ConditionalFilterListenerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/ConditionalFilterListenerTest.php @@ -92,7 +92,7 @@ class ConditionalFilterListenerTest extends TestCase public function testAttach() { $listener = new InjectConditionalFilterListener(self::$emptySearchConfig); - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('pre'), @@ -154,7 +154,7 @@ class ConditionalFilterListenerTest extends TestCase { $params = new ParamBag([ ]); $listener = new InjectConditionalFilterListener(self::$emptySearchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $listener->setAuthorizationService($mockAuth); @@ -180,7 +180,7 @@ class ConditionalFilterListenerTest extends TestCase ] ); $listener = new InjectConditionalFilterListener(self::$emptySearchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $listener->setAuthorizationService($mockAuth); @@ -205,7 +205,7 @@ class ConditionalFilterListenerTest extends TestCase { $params = new ParamBag([ ]); $listener = new InjectConditionalFilterListener(self::$searchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -233,7 +233,7 @@ class ConditionalFilterListenerTest extends TestCase $params = new ParamBag([ ]); $listener = new InjectConditionalFilterListener(self::$searchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -262,7 +262,7 @@ class ConditionalFilterListenerTest extends TestCase ); $listener = new InjectConditionalFilterListener(self::$searchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') @@ -296,7 +296,7 @@ class ConditionalFilterListenerTest extends TestCase ); $listener = new InjectConditionalFilterListener(self::$searchConfig); - $mockAuth = $this->getMockBuilder('ZfcRbac\Service\AuthorizationService') + $mockAuth = $this->getMockBuilder(\ZfcRbac\Service\AuthorizationService::class) ->disableOriginalConstructor() ->getMock(); $mockAuth->expects($this->any())->method('isGranted') diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/FilterFieldConversionListenerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/FilterFieldConversionListenerTest.php index faa65233eee3fec33b1f4a4981edcfddaeb58e86..880319e6adb98f37f736d6ae3d9de62789a39204 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/FilterFieldConversionListenerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/FilterFieldConversionListenerTest.php @@ -53,7 +53,7 @@ class FilterFieldConversionListenerTest extends TestCase public function testAttach() { $listener = new FilterFieldConversionListener(['foo' => 'bar']); - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('pre'), @@ -86,7 +86,7 @@ class FilterFieldConversionListenerTest extends TestCase ['foo' => 'bar', 'baz' => 'boo'] ); - $backend = $this->getMockBuilder('VuFindSearch\Backend\Solr\Backend') + $backend = $this->getMockBuilder(\VuFindSearch\Backend\Solr\Backend::class) ->disableOriginalConstructor()->getMock(); $event = new Event('pre', $backend, ['params' => $params]); $listener->onSearchPre($event); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/HideFacetValueListenerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/HideFacetValueListenerTest.php index 81c61ad31d1f2d6ad481dd68ab90ce7fea06dd4a..a058e3279141eee71e6de435d35f747e85b77d33 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/HideFacetValueListenerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/HideFacetValueListenerTest.php @@ -53,7 +53,7 @@ class HideFacetValueListenerTest extends TestCase */ protected function getMockBackend($id = 'Solr') { - $backend = $this->getMockBuilder('VuFindSearch\Backend\Solr\Backend') + $backend = $this->getMockBuilder(\VuFindSearch\Backend\Solr\Backend::class) ->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getIdentifier')->will( $this->returnValue($id) @@ -120,7 +120,7 @@ class HideFacetValueListenerTest extends TestCase public function testAttach() { $listener = $this->getListener(); - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('post'), diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/MultiIndexListenerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/MultiIndexListenerTest.php index 82d1773dfed84c67f5215a2c408bfefbfa500137..58e59a5d07e267081aebc4e109d409c777fbcd4a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/MultiIndexListenerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/Solr/MultiIndexListenerTest.php @@ -182,7 +182,7 @@ class MultiIndexListenerTest extends TestCase */ public function testAttach() { - $mock = $this->createMock('Zend\EventManager\SharedEventManagerInterface'); + $mock = $this->createMock(\Zend\EventManager\SharedEventManagerInterface::class); $mock->expects($this->once())->method('attach')->with( $this->equalTo('VuFind\Search'), $this->equalTo('pre'), diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/UrlQueryHelperTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/UrlQueryHelperTest.php index ab512b0b5ed8994d961150de9285903cc50d3f40..b0eadd2804f94d3608635c4d2685b344b9f48393 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Search/UrlQueryHelperTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Search/UrlQueryHelperTest.php @@ -144,7 +144,7 @@ class UrlQueryHelperTest extends TestCase public function testFactory() { $factory = new UrlQueryHelperFactory(); - $config = $this->createMock('VuFind\Config\PluginManager'); + $config = $this->createMock(\VuFind\Config\PluginManager::class); $params = new \VuFindTest\Search\TestHarness\Params( new \VuFindTest\Search\TestHarness\Options($config), $config ); 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 e6633f6b39bbf850b881bc6a1beb5d39d8da85b2..99408faeaaad21028c2354b4f0c2c564c0079bc4 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/PluginManagerTest.php @@ -48,7 +48,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testShareByDefault() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $this->assertTrue($this->getProperty($pm, 'sharedByDefault')); } @@ -64,7 +64,7 @@ class PluginManagerTest extends \VuFindTest\Unit\TestCase public function testExpectedInterface() { $pm = new PluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $pm->validate(new \ArrayObject()); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Solr/WriterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Solr/WriterTest.php index 430dd1fb8021df6346e3ae2e0d80dfce7a5258ae..ddb96bee85224aa5b7cf497bf49597e02e0ff9ba 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Solr/WriterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Solr/WriterTest.php @@ -135,10 +135,10 @@ class WriterTest extends \VuFindTest\Unit\TestCase { $sm = new \Zend\ServiceManager\ServiceManager(); $pm = new BackendManager($sm); - $mockBackend = $this->getMockBuilder('VuFindSearch\Backend\Solr\Backend') + $mockBackend = $this->getMockBuilder(\VuFindSearch\Backend\Solr\Backend::class) ->disableOriginalConstructor() ->getMock(); - $mockConnector = $this->getMockBuilder('VuFindSearch\Backend\Solr\Connector') + $mockConnector = $this->getMockBuilder(\VuFindSearch\Backend\Solr\Connector::class) ->disableOriginalConstructor() ->setMethods(['getUrl', 'getTimeout', 'setTimeout', 'write']) ->getMock(); @@ -156,7 +156,7 @@ class WriterTest extends \VuFindTest\Unit\TestCase */ protected function getMockChangeTracker() { - return $this->getMockBuilder('VuFind\Db\Table\ChangeTracker') + return $this->getMockBuilder(\VuFind\Db\Table\ChangeTracker::class) ->disableOriginalConstructor() ->setMethods(['markDeleted']) ->getMock(); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CartTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CartTest.php index 4f943bfbf844e83e9f8033a897d0054306e4b0da..866558a9ef2a8dfa1bbafa6277aea22b0f2bf60e 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CartTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CartTest.php @@ -46,7 +46,7 @@ class CartTest extends \PHPUnit\Framework\TestCase public function testCart() { // Create a mock cart object: - $cart = $this->getMockBuilder('VuFind\Cart') + $cart = $this->getMockBuilder(\VuFind\Cart::class) ->disableOriginalConstructor() ->getMock(); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php index 21b141d395c405d82ac02b0821d4f5e8734c59fb..e8d53f8de25033dcba3b7aec9539bef49417cf6f 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php @@ -223,7 +223,7 @@ class OpenUrlTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getMockContext() { - return $this->getMockBuilder('VuFind\View\Helper\Root\Context') + return $this->getMockBuilder(\VuFind\View\Helper\Root\Context::class) ->disableOriginalConstructor()->getMock(); } @@ -297,7 +297,7 @@ class OpenUrlTest extends \VuFindTest\Unit\ViewHelperTestCase if (null === $mockContext) { $mockContext = $this->getMockContext(); } - $mockPm = $this->getMockBuilder('VuFind\Resolver\Driver\PluginManager') + $mockPm = $this->getMockBuilder(\VuFind\Resolver\Driver\PluginManager::class) ->disableOriginalConstructor()->getMock(); $openUrl = new OpenUrl($mockContext, $rules, $mockPm, new Config($config)); $openUrl->setView($this->getPhpRenderer()); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/PermissionTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/PermissionTest.php index ba64a52f0df32fc502e8767f9b6c44d74740b91c..b6e4a301ba0a0b9239b16dd1c253d7826c4e24b6 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/PermissionTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/PermissionTest.php @@ -154,7 +154,7 @@ class PermissionTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getMockPmd($config = false) { - $mockPmd = $this->getMockBuilder('\VuFind\Role\PermissionDeniedManager') + $mockPmd = $this->getMockBuilder(\VuFind\Role\PermissionDeniedManager::class) ->setConstructorArgs([$this->permissionDeniedConfig]) ->getMock(); $mockPmd->expects($this->any())->method('getDeniedTemplateBehavior') @@ -171,7 +171,7 @@ class PermissionTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getMockPm($isAuthorized = false) { - $mockPm = $this->getMockBuilder('\VuFind\Role\PermissionManager') + $mockPm = $this->getMockBuilder(\VuFind\Role\PermissionManager::class) ->disableOriginalConstructor() ->getMock(); $mockPm->expects($this->any())->method('isAuthorized') @@ -189,7 +189,7 @@ class PermissionTest extends \VuFindTest\Unit\ViewHelperTestCase */ protected function getMockContext() { - return $this->getMockBuilder('VuFind\View\Helper\Root\Context') + return $this->getMockBuilder(\VuFind\View\Helper\Root\Context::class) ->disableOriginalConstructor()->getMock(); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php index daa50dbeb2f7080b0e1a9737178593d936b70905..a40b62396ae9802a63c9d8dbb3110c0f31ac6ccc 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php @@ -51,17 +51,17 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase $context = new \VuFind\View\Helper\Root\Context(); return [ 'auth' => new \VuFind\View\Helper\Root\Auth( - $this->getMockBuilder('VuFind\Auth\Manager')->disableOriginalConstructor()->getMock(), - $this->getMockBuilder('VuFind\Auth\ILSAuthenticator')->disableOriginalConstructor()->getMock() + $this->getMockBuilder(\VuFind\Auth\Manager::class)->disableOriginalConstructor()->getMock(), + $this->getMockBuilder(\VuFind\Auth\ILSAuthenticator::class)->disableOriginalConstructor()->getMock() ), 'context' => $context, 'doi' => new \VuFind\View\Helper\Root\Doi($context), - 'openUrl' => new \VuFind\View\Helper\Root\OpenUrl($context, [], $this->getMockBuilder('VuFind\Resolver\Driver\PluginManager')->disableOriginalConstructor()->getMock()), + 'openUrl' => new \VuFind\View\Helper\Root\OpenUrl($context, [], $this->getMockBuilder(\VuFind\Resolver\Driver\PluginManager::class)->disableOriginalConstructor()->getMock()), 'proxyUrl' => new \VuFind\View\Helper\Root\ProxyUrl(), 'record' => new \VuFind\View\Helper\Root\Record(), - 'recordLink' => new \VuFind\View\Helper\Root\RecordLink($this->getMockBuilder('VuFind\Record\Router')->disableOriginalConstructor()->getMock()), + 'recordLink' => new \VuFind\View\Helper\Root\RecordLink($this->getMockBuilder(\VuFind\Record\Router::class)->disableOriginalConstructor()->getMock()), 'searchOptions' => new \VuFind\View\Helper\Root\SearchOptions(new \VuFind\Search\Options\PluginManager($this->getServiceManager())), - 'searchTabs' => $this->getMockBuilder('VuFind\View\Helper\Root\SearchTabs')->disableOriginalConstructor()->getMock(), + 'searchTabs' => $this->getMockBuilder(\VuFind\View\Helper\Root\SearchTabs::class)->disableOriginalConstructor()->getMock(), 'transEsc' => new \VuFind\View\Helper\Root\TransEsc(), 'translate' => new \VuFind\View\Helper\Root\Translate(), 'usertags' => new \VuFind\View\Helper\Root\UserTags(), @@ -81,7 +81,7 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase $methods = [ 'getBuilding', 'getDeduplicatedAuthors', 'getContainerTitle', 'getTags' ]; - $record = $this->getMockBuilder('VuFind\RecordDriver\SolrDefault') + $record = $this->getMockBuilder(\VuFind\RecordDriver\SolrDefault::class) ->setMethods($methods) ->getMock(); $record->expects($this->any())->method('getTags') @@ -136,7 +136,7 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase $match = new \Zend\Router\RouteMatch([]); $match->setMatchedRouteName('foo'); $view->plugin('url') - ->setRouter($this->createMock('Zend\Router\RouteStackInterface')) + ->setRouter($this->createMock(\Zend\Router\RouteStackInterface::class)) ->setRouteMatch($match); // Inject the view object into all of the helpers: diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php index 2ee0ba6e3d8da4c9759420ebcf21893751950210..f9c6467564429c9f1161bc76703db57086814e2b 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php @@ -164,7 +164,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ public function testGetListEntry() { - $driver = $this->createMock('VuFind\RecordDriver\AbstractBase'); + $driver = $this->createMock(\VuFind\RecordDriver\AbstractBase::class); $driver->expects($this->once())->method('getContainingLists') ->with($this->equalTo(42)) ->will($this->returnValue([1, 2, 3])); @@ -499,7 +499,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase if (null === $context) { $context = $this->getMockContext(); } - $view = $this->getMockBuilder('Zend\View\Renderer\PhpRenderer') + $view = $this->getMockBuilder(\Zend\View\Renderer\PhpRenderer::class) ->disableOriginalConstructor() ->setMethods(['render', 'plugin', 'resolver']) ->getMock(); @@ -536,7 +536,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ protected function getMockResolver() { - return $this->createMock('Zend\View\Resolver\ResolverInterface'); + return $this->createMock(\Zend\View\Resolver\ResolverInterface::class); } /** @@ -546,7 +546,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ protected function getMockContext() { - $context = $this->createMock('VuFind\View\Helper\Root\Context'); + $context = $this->createMock(\VuFind\View\Helper\Root\Context::class); $context->expects($this->any())->method('__invoke') ->will($this->returnValue($context)); return $context; @@ -561,7 +561,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ protected function getMockUrl($expectedRoute) { - $url = $this->createMock('Zend\View\Helper\Url'); + $url = $this->createMock(\Zend\View\Helper\Url::class); $url->expects($this->once())->method('__invoke') ->with($this->equalTo($expectedRoute)) ->will($this->returnValue('http://foo/bar')); @@ -577,7 +577,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ protected function getMockServerUrl() { - $url = $this->createMock('Zend\View\Helper\ServerUrl'); + $url = $this->createMock(\Zend\View\Helper\ServerUrl::class); $url->expects($this->once())->method('__invoke') ->will($this->returnValue('http://server-foo/baz')); return $url; @@ -590,7 +590,7 @@ class RecordTest extends \PHPUnit\Framework\TestCase */ protected function getMockSearchTabs() { - $searchTabs = $this->getMockBuilder('VuFind\View\Helper\Root\SearchTabs') + $searchTabs = $this->getMockBuilder(\VuFind\View\Helper\Root\SearchTabs::class) ->disableOriginalConstructor()->getMock(); $searchTabs->expects($this->any())->method('getCurrentHiddenFilterParams') ->will($this->returnValue('')); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php index 7a8ea1f96568639c255a74be9caca1c584d2304f..a879de3f5cd2dafc51abc56e2e8debf8eacb0e78 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/SafeMoneyFormatTest.php @@ -81,7 +81,7 @@ class SafeMoneyFormatTest extends \PHPUnit\Framework\TestCase public function testFormatting() { $escaper = new \Zend\View\Helper\EscapeHtml(); - $view = $this->createMock('Zend\View\Renderer\PhpRenderer'); + $view = $this->createMock(\Zend\View\Renderer\PhpRenderer::class); $view->expects($this->any())->method('plugin') ->with($this->equalTo('escapeHtml')) ->will($this->returnValue($escaper)); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php index f058cb96a5cbe2931694c304ecace313b4a4bc19..db2c99a5879f00fc8c2bb8d511b447ed939e947e 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/TranslateTest.php @@ -220,7 +220,7 @@ class TranslateTest extends \PHPUnit\Framework\TestCase public function testLocaleWithTranslator() { $translate = new Translate(); - $translator = $this->createMock('Zend\I18n\Translator\Translator'); + $translator = $this->createMock(\Zend\I18n\Translator\Translator::class); $translator->expects($this->once())->method('getLocale') ->will($this->returnValue('foo')); $translate->setTranslator($translator); @@ -235,7 +235,7 @@ class TranslateTest extends \PHPUnit\Framework\TestCase public function testGetTranslator() { $translate = new Translate(); - $translator = $this->createMock('Zend\I18n\Translator\TranslatorInterface'); + $translator = $this->createMock(\Zend\I18n\Translator\TranslatorInterface::class); $translate->setTranslator($translator); $this->assertEquals($translator, $translate->getTranslator()); } @@ -252,7 +252,7 @@ class TranslateTest extends \PHPUnit\Framework\TestCase $callback = function ($str, $domain) use ($translations) { return $translations[$domain][$str] ?? $str; }; - $translator = $this->createMock('Zend\I18n\Translator\TranslatorInterface'); + $translator = $this->createMock(\Zend\I18n\Translator\TranslatorInterface::class); $translator->expects($this->any())->method('translate') ->will($this->returnCallback($callback)); return $translator; diff --git a/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php b/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php index 7a6cfb73c2c8c6d5996b4d1c4bd35413e23c487d..4cdb34b286a907b0e66c0a250f8492c17b7df0c5 100644 --- a/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php +++ b/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php @@ -47,17 +47,17 @@ class SocialstatsControllerTest extends \VuFindTest\Unit\TestCase public function testHome() { // Create mocks to simulate database lookups: - $c = $this->getMockBuilder('VuFindAdmin\Controller\SocialstatsController') + $c = $this->getMockBuilder(\VuFindAdmin\Controller\SocialstatsController::class) ->setMethods(['getTable'])->disableOriginalConstructor()->getMock(); - $comments = $this->getMockBuilder('VuFind\Db\Table\Comments') + $comments = $this->getMockBuilder(\VuFind\Db\Table\Comments::class) ->disableOriginalConstructor()->setMethods(['getStatistics'])->getMock(); $comments->expects($this->once())->method('getStatistics')->will($this->returnValue('comments-data')); $c->expects($this->at(0))->method('getTable')->with($this->equalTo('comments'))->will($this->returnValue($comments)); - $userresource = $this->getMockBuilder('VuFind\Db\Table\UserResource') + $userresource = $this->getMockBuilder(\VuFind\Db\Table\UserResource::class) ->setMethods(['getStatistics'])->disableOriginalConstructor()->getMock(); $userresource->expects($this->once())->method('getStatistics')->will($this->returnValue('userresource-data')); $c->expects($this->at(1))->method('getTable')->with($this->equalTo('userresource'))->will($this->returnValue($userresource)); - $resourcetags = $this->getMockBuilder('VuFind\Db\Table\ResourceTags') + $resourcetags = $this->getMockBuilder(\VuFind\Db\Table\ResourceTags::class) ->disableOriginalConstructor()->setMethods(['getStatistics']) ->getMock(); $resourcetags->expects($this->once())->method('getStatistics')->will($this->returnValue('resourcetags-data')); diff --git a/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/FacetFormatterTest.php b/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/FacetFormatterTest.php index 2f3c71b3e59fd070ef9dd38725dc2ae1a3a2e7b7..7cbba89e5e6a26a8fc7e0457b8ff7ead32b7bef2 100644 --- a/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/FacetFormatterTest.php +++ b/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/FacetFormatterTest.php @@ -156,7 +156,7 @@ class FacetFormatterTest extends \VuFindTest\Unit\TestCase $results = []; $helper = new \VuFind\Search\Solr\HierarchicalFacetHelper(); - $configManager = $this->createMock('VuFind\Config\PluginManager'); + $configManager = $this->createMock(\VuFind\Config\PluginManager::class); $params = new Params(new Options($configManager), $configManager); $requestParams = new \Zend\StdLib\Parameters($request); $params->initFromRequest($requestParams); @@ -181,12 +181,12 @@ class FacetFormatterTest extends \VuFindTest\Unit\TestCase */ protected function getFakeResults($request, $facetData) { - $configManager = $this->createMock('VuFind\Config\PluginManager'); + $configManager = $this->createMock(\VuFind\Config\PluginManager::class); $params = new Params(new Options($configManager), $configManager); $params->initFromRequest(new \Zend\Stdlib\Parameters($request)); - $ss = $this->getMockBuilder('VuFindSearch\Service') + $ss = $this->getMockBuilder(\VuFindSearch\Service::class) ->disableOriginalConstructor()->getMock(); - $rl = $this->getMockBuilder('VuFind\Record\Loader') + $rl = $this->getMockBuilder(\VuFind\Record\Loader::class) ->disableOriginalConstructor()->getMock(); return new Results($params, $ss, $rl, 100, $facetData); } 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 169642533af2417f06ced1a9f9211a27f72b0609..09afece364288026b8bfba950a2ebc457677e890 100644 --- a/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php +++ b/module/VuFindApi/tests/unit-tests/src/VuFindTest/Formatter/RecordFormatterTest.php @@ -80,11 +80,11 @@ class RecordFormatterTest extends \VuFindTest\Unit\TestCase protected function getHelperPluginManager() { $hm = new \Zend\View\HelperPluginManager( - $this->createMock('Interop\Container\ContainerInterface') + $this->createMock(\Interop\Container\ContainerInterface::class) ); $hm->setService('translate', new \VuFind\View\Helper\Root\Translate()); - $mockRecordLink = $this->getMockBuilder('VuFind\View\Helper\Root\RecordLink') + $mockRecordLink = $this->getMockBuilder(\VuFind\View\Helper\Root\RecordLink::class) ->disableOriginalConstructor()->getMock(); $mockRecordLink->expects($this->any())->method('getUrl') ->will($this->returnValue('http://record')); diff --git a/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/Controller/DevtoolsControllerTest.php b/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/Controller/DevtoolsControllerTest.php index 9ff1aeb5fcbabf032cf849bcb3c8d7f71a091fa6..8037c4bbac83556d96ebcd66945b426896d71f1e 100644 --- a/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/Controller/DevtoolsControllerTest.php +++ b/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/Controller/DevtoolsControllerTest.php @@ -84,7 +84,7 @@ class DevtoolsControllerTest extends \VuFindTest\Unit\TestCase protected function getMockController() { $config = new Config(['Languages' => ['en' => 'English']]); - $c = $this->getMockBuilder('VuFindDevTools\Controller\DevtoolsController') + $c = $this->getMockBuilder(\VuFindDevTools\Controller\DevtoolsController::class) ->setMethods(['getConfig'])->disableOriginalConstructor()->getMock(); $c->expects($this->any())->method('getConfig')->will($this->returnValue($config)); return $c; diff --git a/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/LanguageHelperTest.php b/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/LanguageHelperTest.php index 02a09bd4bdc67a7b87b24e9a3a9394ebd05c6507..77ec90569df9da9c08f9caadefffabf0bbbd3d32 100644 --- a/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/LanguageHelperTest.php +++ b/module/VuFindDevTools/tests/unit-tests/src/VuFindTest/LanguageHelperTest.php @@ -90,7 +90,7 @@ class LanguageHelperTest extends \VuFindTest\Unit\TestCase { $config = new Config(['Languages' => ['en' => 'English']]); return new LanguageHelper( - $this->createMock('VuFind\I18n\Translator\Loader\ExtendedIni'), + $this->createMock(\VuFind\I18n\Translator\Loader\ExtendedIni::class), $config ); } diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/BrowZine/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/BrowZine/BackendTest.php index 3101bdbc0a840dbcc96701e4a9aac2c960df2e96..30925a9b5595d94d95fb0f8ab182ece7ff88992d 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/BrowZine/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/BrowZine/BackendTest.php @@ -120,7 +120,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnector(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -185,8 +185,8 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\BrowZine\Connector') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\BrowZine\Connector::class) ->setMethods($mock) ->setConstructorArgs([$client, 'faketoken', 'fakeid']) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EDS/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EDS/BackendTest.php index bb9a13e053c3939696ca4cee0ee8c9eefbb1f1c9..b79f38501c7db69924034a6dd2d0cd66c1dac37a 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EDS/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EDS/BackendTest.php @@ -177,7 +177,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(); $config = [ 'EBSCO_Account' => [ @@ -224,8 +224,8 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\EDS\Zend2') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\EDS\Zend2::class) ->setMethods($mock) ->setConstructorArgs([[], $client]) ->getMock(); @@ -244,13 +244,13 @@ class BackendTest extends \VuFindTest\Unit\TestCase protected function getBackend($connector, $factory = null, $cache = null, $container = null, $settings = [], $mock = null) { if (null === $factory) { - $factory = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $factory = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); } if (null === $cache) { - $cache = $this->createMock('Zend\Cache\Storage\Adapter\Filesystem'); + $cache = $this->createMock(\Zend\Cache\Storage\Adapter\Filesystem::class); } if (null === $container) { - $container = $this->getMockBuilder('Zend\Session\Container') + $container = $this->getMockBuilder(\Zend\Session\Container::class) ->disableOriginalConstructor()->getMock(); } if (null === $mock) { diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EIT/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EIT/BackendTest.php index 58781cf8de6f49e5400e2be1baee234877d27db2..159743c8b9f8a8f2c0425a10bff0baf74d810285 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EIT/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/EIT/BackendTest.php @@ -128,7 +128,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -164,7 +164,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); return $this->getMockBuilder(__NAMESPACE__ . '\ConnectorMock') ->setMethods($mock) ->setConstructorArgs(['http://fake', $client, 'profile', 'pwd', 'dbs']) diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/LibGuides/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/LibGuides/BackendTest.php index eba17deea2c77c4a7d955eb4c7a0630c2515b028..ba33c125ce9c59073a5ead26cca35451cb4c3248 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/LibGuides/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/LibGuides/BackendTest.php @@ -121,7 +121,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnector(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -243,8 +243,8 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\LibGuides\Connector') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\LibGuides\Connector::class) ->setMethods($mock) ->setConstructorArgs(['fakeid', $client]) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Pazpar2/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Pazpar2/BackendTest.php index 493e22d6e1afb0ff10843d4d18918fc23098c7b7..d240d5b779457edd6a840fd03cae5dc3f830c52b 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Pazpar2/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Pazpar2/BackendTest.php @@ -51,12 +51,12 @@ class BackendTest extends TestCase */ public function testGetConnector() { - $connector = $this->getMockBuilder('VuFindSearch\Backend\Pazpar2\Connector') - ->setConstructorArgs(['http://fake', $this->createMock('Zend\Http\Client')]) + $connector = $this->getMockBuilder(\VuFindSearch\Backend\Pazpar2\Connector::class) + ->setConstructorArgs(['http://fake', $this->createMock(\Zend\Http\Client::class)]) ->getMock(); $back = new Backend( $connector, - $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface') + $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class) ); $this->assertEquals($connector, $back->getConnector()); } @@ -149,8 +149,8 @@ class BackendTest extends TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\Pazpar2\Connector') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\Pazpar2\Connector::class) ->setMethods($mock) ->setConstructorArgs(['fake', $client]) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Primo/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Primo/BackendTest.php index 1b585f160f4ef0e0f75a927e9879c769a5e5c5e5..205c71762c0bb540ca0a62b153ad5d7f88647f7e 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Primo/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Primo/BackendTest.php @@ -121,7 +121,7 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -209,8 +209,8 @@ class BackendTest extends \VuFindTest\Unit\TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\Primo\Connector') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\Primo\Connector::class) ->setMethods($mock) ->setConstructorArgs(['http://fakeaddress.none', 'inst-id', $client]) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php index 4f08bd25501ac3aaed7ff0684ef98007b1c60dea..e3b3ffd8c4820e7840b42157dca7d7c0a99c5caf 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/BackendTest.php @@ -286,7 +286,7 @@ class BackendTest extends TestCase public function testRandom() { // Test that random sort parameter is added: - $params = $this->getMockBuilder('VuFindSearch\ParamBag') + $params = $this->getMockBuilder(\VuFindSearch\ParamBag::class) ->setMethods(['set'])->getMock(); $params->expects($this->once())->method('set') ->with($this->equalTo('sort'), $this->matchesRegularExpression('/[0-9]+_random asc/')); @@ -351,7 +351,7 @@ class BackendTest extends TestCase protected function getConnectorMock(array $mock = []) { $map = new HandlerMap(['select' => ['fallback' => true]]); - return $this->getMockBuilder('VuFindSearch\Backend\Solr\Connector') + return $this->getMockBuilder(\VuFindSearch\Backend\Solr\Connector::class) ->setMethods($mock) ->setConstructorArgs(['http://example.org/', $map]) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php index c62ba7436c40fc0c79058f5eec633a17f7589ce3..915cb709a05816361dfd8a1de332732ea7dfea67 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/ConnectorTest.php @@ -134,7 +134,7 @@ class ConnectorTest extends TestCase public function testSaveThrowsUnknownFormat() { $conn = $this->createConnector(); - $document = $this->createMock('VuFindSearch\Backend\Solr\Document\UpdateDocument'); + $document = $this->createMock(\VuFindSearch\Backend\Solr\Document\UpdateDocument::class); $conn->write($document, 'unknown', 'update'); } diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/Response/Json/RecordCollectionTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/Response/Json/RecordCollectionTest.php index 5bc0eeacd0299a3690ae1e519bd08fac4008e7f2..d02b6d932caf20b4277dd77b3e925943fecbd3e4 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/Response/Json/RecordCollectionTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/Response/Json/RecordCollectionTest.php @@ -78,7 +78,7 @@ class RecordCollectionTest extends TestCase ] ); for ($i = 0; $i < 5; $i++) { - $coll->add($this->createMock('VuFindSearch\Response\RecordInterface')); + $coll->add($this->createMock(\VuFindSearch\Response\RecordInterface::class)); } $coll->rewind(); $this->assertEquals(5, $coll->key()); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Summon/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Summon/BackendTest.php index d1d25f0135fec6bab3911c7ab18d07d9e32878c3..f4aaf0fa213a39e237e159c2c3a17ce03fd3df03 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Summon/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Summon/BackendTest.php @@ -125,7 +125,7 @@ class BackendTest extends TestCase */ public function testRetrieveWrapsSummonException() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(['getRecord']); $conn->expects($this->once()) ->method('getRecord') @@ -177,7 +177,7 @@ class BackendTest extends TestCase */ public function testSearchWrapsSummonException() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(['query']); $conn->expects($this->once()) ->method('query') @@ -211,7 +211,7 @@ class BackendTest extends TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -260,7 +260,7 @@ class BackendTest extends TestCase */ protected function getConnectorMock(array $mock = []) { - return $this->getMockBuilder('SerialsSolutions\Summon\Zend2') + return $this->getMockBuilder(\SerialsSolutions\Summon\Zend2::class) ->setMethods($mock) ->setConstructorArgs(['id', 'key']) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/BackendTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/BackendTest.php index 305ec9ba18cebca2dc762433af00d5cbf38533a0..505450072cbeeaf8ebe3bfa7c11418f81d8e1a8e 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/BackendTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/BackendTest.php @@ -113,7 +113,7 @@ class BackendTest extends TestCase */ public function testConstructorSetters() { - $fact = $this->createMock('VuFindSearch\Response\RecordCollectionFactoryInterface'); + $fact = $this->createMock(\VuFindSearch\Response\RecordCollectionFactoryInterface::class); $conn = $this->getConnectorMock(); $back = new Backend($conn, $fact); $this->assertEquals($fact, $back->getRecordCollectionFactory()); @@ -149,8 +149,8 @@ class BackendTest extends TestCase */ protected function getConnectorMock(array $mock = []) { - $client = $this->createMock('Zend\Http\Client'); - return $this->getMockBuilder('VuFindSearch\Backend\WorldCat\Connector') + $client = $this->createMock(\Zend\Http\Client::class); + return $this->getMockBuilder(\VuFindSearch\Backend\WorldCat\Connector::class) ->setMethods($mock) ->setConstructorArgs(['fake', $client]) ->getMock(); diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/ConnectorTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/ConnectorTest.php index 276c42c256d7932c339d90396c7eb31c930ba677..6c0ead00634393a858baf0fc1019456c8f3ce400 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/ConnectorTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/WorldCat/ConnectorTest.php @@ -49,7 +49,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase */ public function testGetHoldings() { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); $connector = new Connector('key', $client); $client->expects($this->once())->method('setMethod') ->with($this->equalTo('POST')) @@ -57,7 +57,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase $client->expects($this->once())->method('setUri') ->with($this->equalTo('http://www.worldcat.org/webservices/catalog/content/libraries/baz?wskey=key&servicelevel=full&frbrGrouping=on')); $body = '<foo>bar</foo>'; - $response = $this->createMock('Zend\Http\Response'); + $response = $this->createMock(\Zend\Http\Response::class); $response->expects($this->once())->method('getBody') ->will($this->returnValue($body)); $response->expects($this->any())->method('isSuccess') @@ -77,12 +77,12 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase */ public function testGetHoldingsHttpFailure() { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); $connector = new Connector('key', $client); $client->expects($this->once())->method('setMethod') ->with($this->equalTo('POST')) ->will($this->returnValue($client)); - $response = $this->createMock('Zend\Http\Response'); + $response = $this->createMock(\Zend\Http\Response::class); $response->expects($this->any())->method('isSuccess') ->will($this->returnValue(false)); $client->expects($this->once())->method('send') @@ -97,7 +97,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase */ public function testGetRecord() { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); $connector = new Connector('key', $client); $client->expects($this->once())->method('setMethod') ->with($this->equalTo('POST')) @@ -105,7 +105,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase $client->expects($this->once())->method('setUri') ->with($this->equalTo('http://www.worldcat.org/webservices/catalog/content/baz?servicelevel=full&wskey=key')); $body = '<foo>bar</foo>'; - $response = $this->createMock('Zend\Http\Response'); + $response = $this->createMock(\Zend\Http\Response::class); $response->expects($this->once())->method('getBody') ->will($this->returnValue($body)); $response->expects($this->any())->method('isSuccess') @@ -123,7 +123,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase */ public function testGetRecordWithError() { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); $connector = new Connector('key', $client); $client->expects($this->once())->method('setMethod') ->with($this->equalTo('POST')) @@ -131,7 +131,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase $client->expects($this->once())->method('setUri') ->with($this->equalTo('http://www.worldcat.org/webservices/catalog/content/baz?servicelevel=full&wskey=key')); $body = '<foo><diagnostic>bad</diagnostic></foo>'; - $response = $this->createMock('Zend\Http\Response'); + $response = $this->createMock(\Zend\Http\Response::class); $response->expects($this->once())->method('getBody') ->will($this->returnValue($body)); $response->expects($this->any())->method('isSuccess') @@ -149,7 +149,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase */ public function testSearch() { - $client = $this->createMock('Zend\Http\Client'); + $client = $this->createMock(\Zend\Http\Client::class); $connector = new Connector('key', $client); $client->expects($this->once())->method('setMethod') ->with($this->equalTo('POST')) @@ -157,7 +157,7 @@ class ConnectorTest extends \PHPUnit\Framework\TestCase $client->expects($this->once())->method('setUri') ->with($this->equalTo('http://www.worldcat.org/webservices/catalog/search/sru?version=1.1&x=y&startRecord=0&maximumRecords=20&servicelevel=full&wskey=key')); $body = '<foo>,<numberOfRecords>1</numberOfRecords><records><record><recordData>bar</recordData></record></records></foo>'; - $response = $this->createMock('Zend\Http\Response'); + $response = $this->createMock(\Zend\Http\Response::class); $response->expects($this->once())->method('getBody') ->will($this->returnValue($body)); $response->expects($this->any())->method('isSuccess') diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/SearchServiceTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/SearchServiceTest.php index 283e3de01ae858fcaf118ec8f5687b7f80a1f525..956bd0377b2e747e6b7869c25fe52ffc8a8d9724 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/SearchServiceTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/SearchServiceTest.php @@ -136,7 +136,7 @@ class SearchServiceTest extends TestCase public function testRetrieveBatchInterface() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestClassForRetrieveBatchInterface'); + $this->backend = $this->createMock(\VuFindTest\TestClassForRetrieveBatchInterface::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -165,7 +165,7 @@ class SearchServiceTest extends TestCase { $service = $this->getService(); $backend = $this->getBackend(); - $mockRecord = $this->createMock('VuFindSearch\Response\RecordInterface'); + $mockRecord = $this->createMock(\VuFindSearch\Response\RecordInterface::class); $response1 = $this->getRecordCollection(); $response1->expects($this->once())->method('add') ->with($this->equalTo($mockRecord)); @@ -198,7 +198,7 @@ class SearchServiceTest extends TestCase public function testRetrieveBatchInterfaceException() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestClassForRetrieveBatchInterface'); + $this->backend = $this->createMock(\VuFindTest\TestClassForRetrieveBatchInterface::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -253,7 +253,7 @@ class SearchServiceTest extends TestCase public function testRandomInterface() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestClassForRandomInterface'); + $this->backend = $this->createMock(\VuFindTest\TestClassForRandomInterface::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -291,7 +291,7 @@ class SearchServiceTest extends TestCase public function testRandomInterfaceWithException() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestClassForRandomInterface'); + $this->backend = $this->createMock(\VuFindTest\TestClassForRandomInterface::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -348,7 +348,7 @@ class SearchServiceTest extends TestCase for ($i = 1; $i < $limit + 1; $i++) { $response = $this->getRecordCollection(); $response->expects($this->any())->method('first') - ->will($this->returnValue($this->createMock('VuFindSearch\Response\RecordInterface'))); + ->will($this->returnValue($this->createMock(\VuFindSearch\Response\RecordInterface::class))); $backend->expects($this->at($i))->method('search') ->with( $this->equalTo($query), @@ -575,7 +575,7 @@ class SearchServiceTest extends TestCase public function testSimilar() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestBackendClassForSimilar'); + $this->backend = $this->createMock(\VuFindTest\TestBackendClassForSimilar::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -621,7 +621,7 @@ class SearchServiceTest extends TestCase public function testSimilarException() { // Use a special backend for this test... - $this->backend = $this->createMock('VuFindTest\TestBackendClassForSimilar'); + $this->backend = $this->createMock(\VuFindTest\TestBackendClassForSimilar::class); $service = $this->getService(); $backend = $this->getBackend(); @@ -651,9 +651,9 @@ class SearchServiceTest extends TestCase */ public function testFailedResolve() { - $mockResponse = $this->createMock('Zend\EventManager\ResponseCollection'); + $mockResponse = $this->createMock(\Zend\EventManager\ResponseCollection::class); $mockResponse->expects($this->any())->method('stopped')->will($this->returnValue(false)); - $em = $this->createMock('Zend\EventManager\EventManagerInterface'); + $em = $this->createMock(\Zend\EventManager\EventManagerInterface::class); $service = new Service(); $em->expects($this->any())->method('triggerUntil') ->with( @@ -674,7 +674,7 @@ class SearchServiceTest extends TestCase protected function getBackend() { if (!$this->backend) { - $this->backend = $this->createMock('VuFindSearch\Backend\BackendInterface'); + $this->backend = $this->createMock(\VuFindSearch\Backend\BackendInterface::class); } return $this->backend; } @@ -686,7 +686,7 @@ class SearchServiceTest extends TestCase */ protected function getService() { - $em = $this->createMock('Zend\EventManager\EventManagerInterface'); + $em = $this->createMock(\Zend\EventManager\EventManagerInterface::class); $service = new SearchServiceMock($this->getBackend()); $service->setEventManager($em); return $service; @@ -701,7 +701,7 @@ class SearchServiceTest extends TestCase */ protected function getRecordCollection() { - return $this->createMock('VuFindSearch\Response\AbstractRecordCollection'); + return $this->createMock(\VuFindSearch\Response\AbstractRecordCollection::class); } } diff --git a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/ThemeMobileTest.php b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/ThemeMobileTest.php index 505d41a63228e6ec899c4ac3a64df03cab1ccd25..a0eb9b7dcbba70d73f2d86b4a085aad02e5e75b7 100644 --- a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/ThemeMobileTest.php +++ b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/ThemeMobileTest.php @@ -65,7 +65,7 @@ class ThemeMobileTest extends Unit\TestCase */ public function testDetection() { - $detector = $this->getMockBuilder('uagent_info') + $detector = $this->getMockBuilder(\uagent_info::class) ->setMethods(['DetectMobileLong']) ->getMock(); $detector->expects($this->once()) diff --git a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/HeadThemeResourcesTest.php b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/HeadThemeResourcesTest.php index 64e078a3934afcf6d21c4779142c85f92de34afe..2f9545f98d4a54d3f6a7c905b5b0c4d69f006613 100644 --- a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/HeadThemeResourcesTest.php +++ b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/HeadThemeResourcesTest.php @@ -92,7 +92,7 @@ class HeadThemeResourcesTest extends \VuFindTest\Unit\TestCase */ protected function getMockView() { - $view = $this->createMock('Zend\View\Renderer\PhpRenderer'); + $view = $this->createMock(\Zend\View\Renderer\PhpRenderer::class); $view->expects($this->at(0))->method('plugin') ->with($this->equalTo('headMeta')) ->will($this->returnValue($this->getMockHeadMeta())); @@ -112,7 +112,7 @@ class HeadThemeResourcesTest extends \VuFindTest\Unit\TestCase */ protected function getMockHeadMeta() { - $mock = $this->getMockBuilder('VuFindTheme\View\Helper\HeadMeta') + $mock = $this->getMockBuilder(\VuFindTheme\View\Helper\HeadMeta::class) ->disableOriginalConstructor() ->setMethods(['__invoke', 'prependHttpEquiv', 'appendName']) ->getMock(); @@ -131,7 +131,7 @@ class HeadThemeResourcesTest extends \VuFindTest\Unit\TestCase */ protected function getMockHeadLink() { - $mock = $this->getMockBuilder('VuFindTheme\View\Helper\HeadLink') + $mock = $this->getMockBuilder(\VuFindTheme\View\Helper\HeadLink::class) ->disableOriginalConstructor() ->getMock(); $mock->expects($this->any())->method('__invoke')->will($this->returnValue($mock)); @@ -145,7 +145,7 @@ class HeadThemeResourcesTest extends \VuFindTest\Unit\TestCase */ protected function getMockHeadScript() { - $mock = $this->getMockBuilder('VuFindTheme\View\Helper\HeadScript') + $mock = $this->getMockBuilder(\VuFindTheme\View\Helper\HeadScript::class) ->disableOriginalConstructor() ->getMock(); $mock->expects($this->any())->method('__invoke')->will($this->returnValue($mock));