[TASK] Use short returns in PHPUnit tests 00/62100/3
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Thu, 24 Oct 2019 14:54:03 +0000 (16:54 +0200)
committerDaniel Goerz <daniel.goerz@posteo.de>
Thu, 24 Oct 2019 17:26:46 +0000 (19:26 +0200)
Usage of PHPUnit’s mock e.g. ->will($this->returnValue(..)) must be
replaced by its shorter equivalent such as ->willReturn(...).

Releases: master
Resolves: #89503
Change-Id: I325e82f546154d1c94464bff03060b4353df6e9e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62100
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
148 files changed:
Build/.php_cs
typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php
typo3/sysext/backend/Tests/Unit/Form/NodeFactoryTest.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php
typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/LogEntryRepositoryTest.php
typo3/sysext/belog/Tests/Unit/Domain/Repository/WorkspaceRepositoryTest.php
typo3/sysext/beuser/Tests/Unit/Service/ModuleDataStorageServiceTest.php
typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/ApcuBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/FileBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/PdoBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/Backend/WincacheBackendTest.php
typo3/sysext/core/Tests/Unit/Cache/CacheManagerTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/PhpFrontendTest.php
typo3/sysext/core/Tests/Unit/Cache/Frontend/VariableFrontendTest.php
typo3/sysext/core/Tests/Unit/Command/SendEmailCommandTest.php
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php
typo3/sysext/core/Tests/Unit/Database/Query/BulkInsertTest.php
typo3/sysext/core/Tests/Unit/Database/RelationHandlerTest.php
typo3/sysext/core/Tests/Unit/Domain/Repository/PageRepositoryTest.php
typo3/sysext/core/Tests/Unit/Error/ProductionExceptionHandlerTest.php
typo3/sysext/core/Tests/Unit/FormProtection/AbstractFormProtectionTest.php
typo3/sysext/core/Tests/Unit/FormProtection/BackendFormProtectionTest.php
typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php
typo3/sysext/core/Tests/Unit/Log/LoggerTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionProcessorTest.php
typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php
typo3/sysext/core/Tests/Unit/Resource/AbstractFileTest.php
typo3/sysext/core/Tests/Unit/Resource/BaseTestCase.php
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php
typo3/sysext/core/Tests/Unit/Resource/FileReferenceTest.php
typo3/sysext/core/Tests/Unit/Resource/FileTest.php
typo3/sysext/core/Tests/Unit/Resource/FolderTest.php
typo3/sysext/core/Tests/Unit/Resource/Index/ExtractorRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php
typo3/sysext/core/Tests/Unit/Resource/OnlineMedia/Helpers/VimeoHelperTest.php
typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php
typo3/sysext/core/Tests/Unit/Resource/Processing/LocalPreviewHelperTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/AudioTagRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/VideoTagRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceCompressorTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceFactoryTest.php
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php
typo3/sysext/core/Tests/Unit/Resource/Service/ExtractorServiceTest.php
typo3/sysext/core/Tests/Unit/Resource/TextExtraction/PlainTextExtractorTest.php
typo3/sysext/core/Tests/Unit/Resource/TextExtraction/TextExtractorRegistryTest.php
typo3/sysext/core/Tests/Unit/Service/FlexFormServiceTest.php
typo3/sysext/core/Tests/Unit/Tree/TableConfiguration/DatabaseTreeDataProviderTest.php
typo3/sysext/core/Tests/Unit/TypoScript/TemplateServiceTest.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionManagementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/File/ExtendedFileUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/AbstractConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/BackendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/BackendUserGroupRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/CategoryRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Domain/Repository/FileMountRepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/AbstractControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ArgumentsTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/MvcPropertyMappingConfigurationServiceTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/RequestTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/View/JsonViewTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/RequestBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryFactoryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/SessionTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbBackendTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php
typo3/sysext/extbase/Tests/Unit/Property/PropertyMapperTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/DateTimeConverterTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/ObjectConverterTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
typo3/sysext/extbase/Tests/Unit/Service/ExtensionServiceTest.php
typo3/sysext/extbase/Tests/Unit/SignalSlot/DispatcherTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/CollectionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/ConjunctionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/DisjunctionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/GenericObjectValidatorTest.php
typo3/sysext/extensionmanager/Tests/Unit/Controller/DownloadControllerTest.php
typo3/sysext/extensionmanager/Tests/Unit/Controller/UploadExtensionFileControllerTest.php
typo3/sysext/extensionmanager/Tests/Unit/Domain/Repository/RepositoryRepositoryTest.php
typo3/sysext/extensionmanager/Tests/Unit/Report/ExtensionStatusTest.php
typo3/sysext/extensionmanager/Tests/Unit/Service/ExtensionManagementServiceTest.php
typo3/sysext/extensionmanager/Tests/Unit/Task/UpdateExtensionListTaskTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/DependencyUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/ExtensionModelUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/FileHandlingUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/InstallUtilityTest.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/ListUtilityTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestBuilderTest.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestTest.php
typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/FlashMessagesViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormFieldViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/AbstractFormViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/HiddenViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/Select/OptionViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/CropViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/EmailViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/ExternalViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/PageViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Widget/Controller/PaginateControllerTest.php
typo3/sysext/form/Tests/Unit/Controller/FormManagerControllerTest.php
typo3/sysext/form/Tests/Unit/Mvc/Configuration/TypoScriptServiceTest.php
typo3/sysext/frontend/Tests/Functional/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FilesContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Plugin/AbstractPluginTest.php
typo3/sysext/frontend/Tests/Unit/Processor/GalleryProcessorTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/RootNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/StructureFacadeTest.php
typo3/sysext/install/Tests/Unit/Service/CoreVersionServiceTest.php
typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php
typo3/sysext/recycler/Tests/Unit/Task/CleanerFieldProviderTest.php
typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php
typo3/sysext/seo/Tests/Unit/XmlSitemap/PagesXmlSitemapDataProviderTest.php

index ca690dd..3edf1cf 100644 (file)
@@ -82,6 +82,7 @@ return PhpCsFixer\Config::create()
         'no_useless_else' => true,
         'no_whitespace_in_blank_line' => true,
         'ordered_imports' => true,
+        'php_unit_mock_short_will_return' => true,
         'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
         'phpdoc_no_access' => true,
         'phpdoc_no_empty_return' => true,
index bee48c8..b84c54e 100644 (file)
@@ -72,9 +72,9 @@ class FileControllerTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->getMock();
 
-        $this->fileResourceMock->expects(self::any())->method('toArray')->will(self::returnValue(['id' => 'foo']));
-        $this->fileResourceMock->expects(self::any())->method('getModificationTime')->will(self::returnValue(123456789));
-        $this->fileResourceMock->expects(self::any())->method('getExtension')->will(self::returnValue('html'));
+        $this->fileResourceMock->expects(self::any())->method('toArray')->willReturn(['id' => 'foo']);
+        $this->fileResourceMock->expects(self::any())->method('getModificationTime')->willReturn(123456789);
+        $this->fileResourceMock->expects(self::any())->method('getExtension')->willReturn('html');
 
         $serverRequest = $this->prophesize(ServerRequestInterface::class);
         $GLOBALS['TYPO3_REQUEST'] = $serverRequest->reveal();
@@ -174,7 +174,7 @@ class FileControllerTest extends UnitTestCase
     public function processAjaxRequestReturnsStatus500IfErrorOccurs()
     {
         $subject = $this->getAccessibleMock(FileController::class, ['init', 'main']);
-        $this->mockFileProcessor->expects(self::any())->method('getErrorMessages')->will(self::returnValue(['error occured']));
+        $this->mockFileProcessor->expects(self::any())->method('getErrorMessages')->willReturn(['error occured']);
         $subject->_set('fileProcessor', $this->mockFileProcessor);
         $result = $subject->processAjaxRequest($this->request, $this->response);
         self::assertEquals(500, $result->getStatusCode());
index 7ffb4ee..db4bb1c 100644 (file)
@@ -279,7 +279,7 @@ class NodeFactoryTest extends UnitTestCase
             ->setMethods(['instantiate'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockSubject->expects(self::once())->method('instantiate')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::once())->method('instantiate')->willReturn($mockNode);
         $mockSubject->create(['renderType' => 'foo']);
     }
 
@@ -350,7 +350,7 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::once())->method('instantiate')->with('stdClass')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::once())->method('instantiate')->with('stdClass')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -377,7 +377,7 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::once())->method('instantiate')->with('foo2Class')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::once())->method('instantiate')->with('foo2Class')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -404,7 +404,7 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::once())->method('instantiate')->with('foo2Class')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::once())->method('instantiate')->with('foo2Class')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -429,7 +429,7 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::at(0))->method('instantiate')->will(self::returnValue($mockResolver));
+        $mockSubject->expects(self::at(0))->method('instantiate')->willReturn($mockResolver);
         $mockSubject->create($data);
     }
 
@@ -467,9 +467,9 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo2Class')->will(self::returnValue($mockResolver2));
-        $mockSubject->expects(self::at(1))->method('instantiate')->with('foo1Class')->will(self::returnValue($mockResolver1));
-        $mockSubject->expects(self::at(2))->method('instantiate')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo2Class')->willReturn($mockResolver2);
+        $mockSubject->expects(self::at(1))->method('instantiate')->with('foo1Class')->willReturn($mockResolver1);
+        $mockSubject->expects(self::at(2))->method('instantiate')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -507,9 +507,9 @@ class NodeFactoryTest extends UnitTestCase
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo1Class')->will(self::returnValue($mockResolver1));
-        $mockSubject->expects(self::at(1))->method('instantiate')->with('foo2Class')->will(self::returnValue($mockResolver2));
-        $mockSubject->expects(self::at(2))->method('instantiate')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo1Class')->willReturn($mockResolver1);
+        $mockSubject->expects(self::at(1))->method('instantiate')->with('foo2Class')->willReturn($mockResolver2);
+        $mockSubject->expects(self::at(2))->method('instantiate')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -536,14 +536,14 @@ class NodeFactoryTest extends UnitTestCase
             ],
         ];
         $mockResolver1 = $this->createMock(NodeResolverInterface::class);
-        $mockResolver1->expects(self::once())->method('resolve')->will(self::returnValue('fooNodeClass'));
+        $mockResolver1->expects(self::once())->method('resolve')->willReturn('fooNodeClass');
 
         /** @var NodeFactory|\PHPUnit_Framework_MockObject_MockObject $mockSubject */
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::at(0))->method('instantiate')->will(self::returnValue($mockResolver1));
-        $mockSubject->expects(self::at(1))->method('instantiate')->with('fooNodeClass')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::at(0))->method('instantiate')->willReturn($mockResolver1);
+        $mockSubject->expects(self::at(1))->method('instantiate')->with('fooNodeClass')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 
@@ -575,14 +575,14 @@ class NodeFactoryTest extends UnitTestCase
             ],
         ];
         $mockResolver1 = $this->createMock(NodeResolverInterface::class);
-        $mockResolver1->expects(self::once())->method('resolve')->will(self::returnValue('fooNodeClass'));
+        $mockResolver1->expects(self::once())->method('resolve')->willReturn('fooNodeClass');
 
         /** @var NodeFactory|\PHPUnit_Framework_MockObject_MockObject $mockSubject */
         $mockSubject = $this->getMockBuilder(NodeFactory::class)
             ->setMethods(['instantiate'])
             ->getMock();
-        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo1Class')->will(self::returnValue($mockResolver1));
-        $mockSubject->expects(self::at(1))->method('instantiate')->with('fooNodeClass')->will(self::returnValue($mockNode));
+        $mockSubject->expects(self::at(0))->method('instantiate')->with('foo1Class')->willReturn($mockResolver1);
+        $mockSubject->expects(self::at(1))->method('instantiate')->with('fooNodeClass')->willReturn($mockNode);
         $mockSubject->create($data);
     }
 }
index 731730c..c10e73f 100644 (file)
@@ -864,7 +864,7 @@ class BackendUtilityTest extends UnitTestCase
     {
         // Stub LanguageService and let sL() return the same value that came in again
         $GLOBALS['LANG'] = $this->createMock(LanguageService::class);
-        $GLOBALS['LANG']->expects(self::any())->method('sL')->will(self::returnArgument(0));
+        $GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
 
         $GLOBALS['TCA'][$table] = $tca;
         $label = BackendUtility::getLabelsFromItemsList($table, $col, $keyList, $pageTsConfig);
@@ -893,7 +893,7 @@ class BackendUtilityTest extends UnitTestCase
         ];
         // Stub LanguageService and let sL() return the same value that came in again
         $GLOBALS['LANG'] = $this->createMock(LanguageService::class);
-        $GLOBALS['LANG']->expects(self::any())->method('sL')->will(self::returnArgument(0));
+        $GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
 
         $GLOBALS['TCA'][$table] = $tca;
         $label = BackendUtility::getProcessedValue($table, $col, 'foo,invalidKey,bar');
@@ -921,7 +921,7 @@ class BackendUtilityTest extends UnitTestCase
         ];
         // Stub LanguageService and let sL() return the same value that came in again
         $GLOBALS['LANG'] = $this->createMock(LanguageService::class);
-        $GLOBALS['LANG']->expects(self::any())->method('sL')->will(self::returnArgument(0));
+        $GLOBALS['LANG']->expects(self::any())->method('sL')->willReturnArgument(0);
 
         $GLOBALS['TCA'][$table] = $tca;
         $label = BackendUtility::getProcessedValue($table, $col, 'invalidKey');
index 7e07cb0..01c7928 100644 (file)
@@ -57,7 +57,7 @@ class BackendLayoutCollectionTest extends UnitTestCase
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backendLayoutMock->expects(self::once())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
+        $backendLayoutMock->expects(self::once())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
 
         $backendLayoutCollection->add($backendLayoutMock);
     }
@@ -76,12 +76,12 @@ class BackendLayoutCollectionTest extends UnitTestCase
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $firstBackendLayoutMock->expects(self::once())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
+        $firstBackendLayoutMock->expects(self::once())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
         $secondBackendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class)
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $secondBackendLayoutMock->expects(self::once())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
+        $secondBackendLayoutMock->expects(self::once())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
 
         $backendLayoutCollection->add($firstBackendLayoutMock);
         $backendLayoutCollection->add($secondBackendLayoutMock);
@@ -99,7 +99,7 @@ class BackendLayoutCollectionTest extends UnitTestCase
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backendLayoutMock->expects(self::once())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
+        $backendLayoutMock->expects(self::once())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
 
         $backendLayoutCollection->add($backendLayoutMock);
 
index 142f071..03f358d 100644 (file)
@@ -76,8 +76,8 @@ class DataProviderCollectionTest extends UnitTestCase
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backendLayoutMock->expects(self::any())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
-        $dataProviderMock->expects(self::once())->method('getBackendLayout')->will(self::returnValue($backendLayoutMock));
+        $backendLayoutMock->expects(self::any())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
+        $dataProviderMock->expects(self::once())->method('getBackendLayout')->willReturn($backendLayoutMock);
 
         $this->dataProviderCollection->add('default', $dataProviderMock);
         $providedBackendLayout = $this->dataProviderCollection->getBackendLayout($backendLayoutIdentifier, 123);
@@ -102,8 +102,8 @@ class DataProviderCollectionTest extends UnitTestCase
             ->setMethods(['getIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backendLayoutMock->expects(self::any())->method('getIdentifier')->will(self::returnValue($backendLayoutIdentifier));
-        $dataProviderMock->expects(self::once())->method('getBackendLayout')->will(self::returnValue($backendLayoutMock));
+        $backendLayoutMock->expects(self::any())->method('getIdentifier')->willReturn($backendLayoutIdentifier);
+        $dataProviderMock->expects(self::once())->method('getBackendLayout')->willReturn($backendLayoutMock);
 
         $this->dataProviderCollection->add($dataProviderIdentifier, $dataProviderMock);
         $providedBackendLayout = $this->dataProviderCollection->getBackendLayout($dataProviderIdentifier . '__' . $backendLayoutIdentifier, 123);
index 31f5b88..021e143 100644 (file)
@@ -54,10 +54,10 @@ class BackendLayoutViewTest extends UnitTestCase
 
         $this->backendLayoutView->expects(self::once())
             ->method('getPage')->with(self::equalTo($pageId))
-            ->will(self::returnValue($page));
+            ->willReturn($page);
         $this->backendLayoutView->expects(self::any())
             ->method('getRootLine')->with(self::equalTo($pageId))
-            ->will(self::returnValue($rootLine));
+            ->willReturn($rootLine);
 
         $selectedCombinedIdentifier = $this->backendLayoutView->_call('getSelectedCombinedIdentifier', $pageId);
         self::assertEquals($expected, $selectedCombinedIdentifier);
index ee76c37..4f0c1cc 100644 (file)
@@ -29,7 +29,7 @@ class LogEntryRepositoryTest extends UnitTestCase
         /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings $querySettings */
         $querySettings = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->getMock();
         $objectManager = $this->getMockBuilder(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class)->getMock();
-        $objectManager->expects(self::any())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::any())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->willReturn($querySettings);
         $querySettings->expects(self::atLeastOnce())->method('setRespectStoragePage')->with(false);
         /** @var \TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository|\PHPUnit_Framework_MockObject_MockObject $subject */
         $subject = $this->getMockBuilder(\TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository::class)
index bbdfeb7..74e9df0 100644 (file)
@@ -28,7 +28,7 @@ class WorkspaceRepositoryTest extends UnitTestCase
     {
         $querySettings = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->getMock();
         $objectManager = $this->getMockBuilder(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class)->getMock();
-        $objectManager->expects(self::any())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::any())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)->willReturn($querySettings);
         $querySettings->expects(self::atLeastOnce())->method('setRespectStoragePage')->with(false);
         $subject = $this->getMockBuilder(\TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository::class)
             ->setMethods(['setDefaultQuerySettings'])
index 36bb7d6..0b67fb7 100644 (file)
@@ -39,7 +39,7 @@ class ModuleDataStorageServiceTest extends UnitTestCase
             ->expects(self::once())
             ->method('get')
             ->with(\TYPO3\CMS\Beuser\Domain\Model\ModuleData::class)
-            ->will(self::returnValue($moduleDataMock));
+            ->willReturn($moduleDataMock);
         $subject->_set('objectManager', $objectManagerMock);
 
         self::assertSame($moduleDataMock, $subject->loadModuleData());
index 85b0f4a..77f62d7 100644 (file)
@@ -185,19 +185,19 @@ class BackendUserAuthenticationTest extends UnitTestCase
         $subject
             ->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue(false));
+            ->willReturn(false);
 
         $subject->setLogger(new NullLogger());
         $subject
             ->expects(self::any())
             ->method('getTSConfig')
-            ->will(self::returnValue([
+            ->willReturn([
                 'permissions.' => [
                     'file.' => [
                         'default.' => $userTsConfiguration
                     ],
                 ]
-            ]));
+            ]);
 
         $expectedPermissions = array_merge($this->defaultFilePermissions, $userTsConfiguration);
         array_walk(
@@ -324,22 +324,22 @@ class BackendUserAuthenticationTest extends UnitTestCase
             ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
             ->getMock();
         $storageMock = $this->createMock(ResourceStorage::class);
-        $storageMock->expects(self::any())->method('getUid')->will(self::returnValue($storageUid));
+        $storageMock->expects(self::any())->method('getUid')->willReturn($storageUid);
 
         $subject
             ->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue(false));
+            ->willReturn(false);
 
         $subject
             ->expects(self::any())
             ->method('getFilePermissions')
-            ->will(self::returnValue($defaultPermissions));
+            ->willReturn($defaultPermissions);
 
         $subject
             ->expects(self::any())
             ->method('getTSConfig')
-            ->will(self::returnValue([
+            ->willReturn([
                 'permissions.' => [
                     'file.' => [
                         'storage.' => [
@@ -347,7 +347,7 @@ class BackendUserAuthenticationTest extends UnitTestCase
                         ],
                     ],
                 ]
-            ]));
+            ]);
 
         self::assertEquals($expectedPermissions, $subject->getFilePermissionsForStorage($storageMock));
     }
@@ -366,22 +366,22 @@ class BackendUserAuthenticationTest extends UnitTestCase
             ->setMethods(['isAdmin', 'getFilePermissions', 'getTSConfig'])
             ->getMock();
         $storageMock = $this->createMock(ResourceStorage::class);
-        $storageMock->expects(self::any())->method('getUid')->will(self::returnValue($storageUid));
+        $storageMock->expects(self::any())->method('getUid')->willReturn($storageUid);
 
         $subject
             ->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue(true));
+            ->willReturn(true);
 
         $subject
             ->expects(self::any())
             ->method('getFilePermissions')
-            ->will(self::returnValue($defaultPermissions));
+            ->willReturn($defaultPermissions);
 
         $subject
             ->expects(self::any())
             ->method('getTSConfig')
-            ->will(self::returnValue([
+            ->willReturn([
                 'permissions.' => [
                     'file.' => [
                         'storage.' => [
@@ -389,7 +389,7 @@ class BackendUserAuthenticationTest extends UnitTestCase
                         ],
                     ],
                 ]
-            ]));
+            ]);
 
         self::assertEquals($defaultPermissions, $subject->getFilePermissionsForStorage($storageMock));
     }
@@ -521,12 +521,12 @@ class BackendUserAuthenticationTest extends UnitTestCase
         $subject
             ->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue(false));
+            ->willReturn(false);
 
         $subject
             ->expects(self::any())
             ->method('getTSConfig')
-            ->will(self::returnValue([]));
+            ->willReturn([]);
         $subject->groupData['file_permissions'] = $permissionValue;
         self::assertEquals($expectedPermissions, $subject->getFilePermissions());
     }
@@ -544,7 +544,7 @@ class BackendUserAuthenticationTest extends UnitTestCase
         $subject
             ->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue(true));
+            ->willReturn(true);
 
         $expectedPermissions = [
             'addFile' => true,
@@ -773,7 +773,7 @@ class BackendUserAuthenticationTest extends UnitTestCase
         $subject->setLogger(new NullLogger());
         $subject->expects(self::any())
             ->method('isAdmin')
-            ->will(self::returnValue($admin));
+            ->willReturn($admin);
 
         $subject->user = ['uid' => 123];
         $subject->groupList = $groups;
index 5334d5a..36c22aa 100644 (file)
@@ -214,13 +214,13 @@ class ApcuBackendTest extends UnitTestCase
     {
         /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $thisCache */
         $thisCache = $this->createMock(FrontendInterface::class);
-        $thisCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thisCache'));
+        $thisCache->expects(self::any())->method('getIdentifier')->willReturn('thisCache');
         $thisBackend = new ApcuBackend('Testing');
         $thisBackend->setCache($thisCache);
 
         /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $thatCache */
         $thatCache = $this->createMock(FrontendInterface::class);
-        $thatCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thatCache'));
+        $thatCache->expects(self::any())->method('getIdentifier')->willReturn('thatCache');
         $thatBackend = new ApcuBackend('Testing');
         $thatBackend->setCache($thatCache);
         $thisBackend->set('thisEntry', 'Hello');
index 0c7d70f..9d4113b 100644 (file)
@@ -155,7 +155,7 @@ class FileBackendTest extends UnitTestCase
     public function getCacheDirectoryReturnsTheCurrentCacheDirectory(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('SomeCache'));
+        $mockCache->expects(self::any())->method('getIdentifier')->willReturn('SomeCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -174,7 +174,7 @@ class FileBackendTest extends UnitTestCase
     public function aDedicatedCacheDirectoryIsUsedForCodeCaches(): void
     {
         $mockCache = $this->createMock(PhpFrontend::class);
-        $mockCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('SomeCache'));
+        $mockCache->expects(self::any())->method('getIdentifier')->willReturn('SomeCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -214,7 +214,7 @@ class FileBackendTest extends UnitTestCase
     public function setReallySavesToTheSpecifiedDirectory(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $data = 'some data' . microtime();
         $entryIdentifier = 'BackendFileTest';
@@ -241,7 +241,7 @@ class FileBackendTest extends UnitTestCase
     public function setOverwritesAnAlreadyExistingCacheEntryForTheSameIdentifier(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $data1 = 'some data' . microtime();
         $data2 = 'some data' . microtime();
@@ -270,7 +270,7 @@ class FileBackendTest extends UnitTestCase
     public function setAlsoSavesSpecifiedTags(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $data = 'some data' . microtime();
         $entryIdentifier = 'BackendFileRemoveBeforeSetTest';
@@ -303,7 +303,7 @@ class FileBackendTest extends UnitTestCase
     public function setCacheDetectsAndLoadsAFrozenCache(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $data = 'some data' . microtime();
         $entryIdentifier = 'BackendFileTest';
@@ -339,7 +339,7 @@ class FileBackendTest extends UnitTestCase
     public function getReturnsContentOfTheCorrectCacheFile(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['setTag'])
@@ -367,13 +367,13 @@ class FileBackendTest extends UnitTestCase
     public function getReturnsFalseForExpiredEntries(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backend->expects(self::once())->method('isCacheFileExpired')->with('vfs://Foo/cache/data/UnitTestCache/ExpiredEntry')->will(self::returnValue(true));
+        $backend->expects(self::once())->method('isCacheFileExpired')->with('vfs://Foo/cache/data/UnitTestCache/ExpiredEntry')->willReturn(true);
         $backend->setCacheDirectory('vfs://Foo/');
         $backend->setCache($mockCache);
 
@@ -387,7 +387,7 @@ class FileBackendTest extends UnitTestCase
     public function getDoesNotCheckIfAnEntryIsExpiredIfTheCacheIsFrozen(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
@@ -411,7 +411,7 @@ class FileBackendTest extends UnitTestCase
     public function hasReturnsTrueIfAnEntryExists(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -454,7 +454,7 @@ class FileBackendTest extends UnitTestCase
     public function hasDoesNotCheckIfAnEntryIsExpiredIfTheCacheIsFrozen(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
@@ -478,7 +478,7 @@ class FileBackendTest extends UnitTestCase
     public function removeReallyRemovesACacheEntry(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $data = 'some data' . microtime();
         $entryIdentifier = 'BackendFileTest';
@@ -529,7 +529,7 @@ class FileBackendTest extends UnitTestCase
         $this->expectExceptionCode(1282073032);
 
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -553,7 +553,7 @@ class FileBackendTest extends UnitTestCase
         $this->expectExceptionCode(1282073033);
 
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -595,7 +595,7 @@ class FileBackendTest extends UnitTestCase
         $this->expectExceptionCode(1282073035);
 
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -619,7 +619,7 @@ class FileBackendTest extends UnitTestCase
         $this->expectExceptionCode(1282073036);
 
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -638,7 +638,7 @@ class FileBackendTest extends UnitTestCase
     public function requireOnceIncludesAndReturnsResultOfIncludedPhpFile(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -663,7 +663,7 @@ class FileBackendTest extends UnitTestCase
     public function requireOnceDoesNotCheckExpiryTimeIfBackendIsFrozen(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
@@ -693,7 +693,7 @@ class FileBackendTest extends UnitTestCase
         $this->expectException(\InvalidArgumentException::class);
         $this->expectExceptionCode(1532528246);
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -711,7 +711,7 @@ class FileBackendTest extends UnitTestCase
     public function requireIncludesAndReturnsResultOfIncludedPhpFile(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
             ->disableOriginalConstructor()
@@ -734,7 +734,7 @@ class FileBackendTest extends UnitTestCase
     public function requireDoesNotCheckExpiryTimeIfBackendIsFrozen(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
             ->disableOriginalConstructor()
@@ -777,7 +777,7 @@ class FileBackendTest extends UnitTestCase
     public function findIdentifiersByTagFindsCacheEntriesWithSpecifiedTag(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -805,7 +805,7 @@ class FileBackendTest extends UnitTestCase
     public function findIdentifiersByTagDoesNotReturnExpiredEntries(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -830,7 +830,7 @@ class FileBackendTest extends UnitTestCase
     public function flushRemovesAllCacheEntries(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -859,7 +859,7 @@ class FileBackendTest extends UnitTestCase
     public function flushCreatesCacheDirectoryAgain(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
@@ -882,11 +882,11 @@ class FileBackendTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->getMock();
 
-        $backend->expects(self::once())->method('findIdentifiersByTag')->with('UnitTestTag%special')->will(self::returnValue([
+        $backend->expects(self::once())->method('findIdentifiersByTag')->with('UnitTestTag%special')->willReturn([
             'foo',
             'bar',
             'baz'
-        ]));
+        ]);
         $backend->expects(self::at(1))->method('remove')->with('foo');
         $backend->expects(self::at(2))->method('remove')->with('bar');
         $backend->expects(self::at(3))->method('remove')->with('baz');
@@ -901,7 +901,7 @@ class FileBackendTest extends UnitTestCase
     public function collectGarbageRemovesExpiredCacheEntries(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['isCacheFileExpired'])
@@ -933,7 +933,7 @@ class FileBackendTest extends UnitTestCase
     public function flushUnfreezesTheCache(): void
     {
         $mockCache = $this->createMock(AbstractFrontend::class);
-        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('UnitTestCache'));
+        $mockCache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('UnitTestCache');
 
         $backend = $this->getMockBuilder(FileBackend::class)
             ->setMethods(['dummy'])
index 122b9bd..37a77b8 100644 (file)
@@ -218,11 +218,11 @@ class PdoBackendTest extends UnitTestCase
     public function flushRemovesOnlyOwnEntries()
     {
         $thisCache = $this->createMock(FrontendInterface::class);
-        $thisCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thisCache'));
+        $thisCache->expects(self::any())->method('getIdentifier')->willReturn('thisCache');
         $thisBackend = $this->setUpBackend();
         $thisBackend->setCache($thisCache);
         $thatCache = $this->createMock(FrontendInterface::class);
-        $thatCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thatCache'));
+        $thatCache->expects(self::any())->method('getIdentifier')->willReturn('thatCache');
         $thatBackend = $this->setUpBackend();
         $thatBackend->setCache($thatCache);
         $thisBackend->set('thisEntry', 'Hello');
@@ -279,7 +279,7 @@ class PdoBackendTest extends UnitTestCase
     protected function setUpBackend()
     {
         $mockCache = $this->createMock(FrontendInterface::class);
-        $mockCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('TestCache'));
+        $mockCache->expects(self::any())->method('getIdentifier')->willReturn('TestCache');
         $backend = GeneralUtility::makeInstance(PdoBackend::class, 'Testing');
         $backend->setCache($mockCache);
         $backend->setDataSourceName('sqlite::memory:');
index fa0f102..117d014 100644 (file)
@@ -199,13 +199,13 @@ class WincacheBackendTest extends UnitTestCase
     {
         /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $thisCache */
         $thisCache = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class);
-        $thisCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thisCache'));
+        $thisCache->expects(self::any())->method('getIdentifier')->willReturn('thisCache');
         $thisBackend = new WincacheBackend('Testing');
         $thisBackend->setCache($thisCache);
 
         /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $thatCache */
         $thatCache = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class);
-        $thatCache->expects(self::any())->method('getIdentifier')->will(self::returnValue('thatCache'));
+        $thatCache->expects(self::any())->method('getIdentifier')->willReturn('thatCache');
         $thatBackend = new WincacheBackend('Testing');
         $thatBackend->setCache($thatCache);
         $thisBackend->set('thisEntry', 'Hello');
index db1b661..5d949e3 100644 (file)
@@ -49,12 +49,12 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('test'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('test');
         $cache2 = $this->getMockBuilder(AbstractFrontend::class)
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache2->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('test'));
+        $cache2->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('test');
         $manager->registerCache($cache1);
         $manager->registerCache($cache2);
     }
@@ -69,12 +69,12 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache1'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache1');
         $cache2 = $this->getMockBuilder(AbstractFrontend::class)
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache2->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache2'));
+        $cache2->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache2');
         $manager->registerCache($cache1);
         $manager->registerCache($cache2);
         self::assertSame($cache2, $manager->getCache('cache2'), 'The cache returned by getCache() was not the same I registered.');
@@ -93,7 +93,7 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('someidentifier'));
+        $cache->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('someidentifier');
         $manager->registerCache($cache);
         $manager->getCache('someidentifier');
         $manager->getCache('doesnotexist');
@@ -109,7 +109,7 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache1'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache1');
         $manager->registerCache($cache1);
         self::assertTrue($manager->hasCache('cache1'), 'hasCache() did not return TRUE.');
         self::assertFalse($manager->hasCache('cache2'), 'hasCache() did not return FALSE.');
@@ -125,7 +125,7 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache1'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache1');
         $cache1->expects(self::once())->method('flushByTag')->with(self::equalTo('theTag'));
         $manager->registerCache($cache1);
         $cache2 = $this->getMockBuilder(AbstractFrontend::class)
@@ -147,7 +147,7 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTags'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache1'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache1');
         $cache1->expects(self::once())->method('flushByTags')->with(self::equalTo(['theTag']));
         $manager->registerCache($cache1);
         $cache2 = $this->getMockBuilder(AbstractFrontend::class)
@@ -169,7 +169,7 @@ class CacheManagerTest extends UnitTestCase
             ->setMethods(['getIdentifier', 'set', 'get', 'has', 'remove', 'flush', 'flushByTag'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->will(self::returnValue('cache1'));
+        $cache1->expects(self::atLeastOnce())->method('getIdentifier')->willReturn('cache1');
         $cache1->expects(self::once())->method('flush');
         $manager->registerCache($cache1);
         $cache2 = $this->getMockBuilder(AbstractFrontend::class)
index c4403c5..43d014c 100644 (file)
@@ -33,7 +33,7 @@ class PhpFrontendTest extends UnitTestCase
             ->setMethods(['isValidEntryIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache->expects(self::once())->method('isValidEntryIdentifier')->with('foo')->will(self::returnValue(false));
+        $cache->expects(self::once())->method('isValidEntryIdentifier')->with('foo')->willReturn(false);
         $cache->set('foo', 'bar');
     }
 
@@ -71,7 +71,7 @@ class PhpFrontendTest extends UnitTestCase
     public function requireOnceCallsTheBackendsRequireOnceMethod()
     {
         $mockBackend = $this->createMock(\TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface::class);
-        $mockBackend->expects(self::once())->method('requireOnce')->with('Foo-Bar')->will(self::returnValue('hello world!'));
+        $mockBackend->expects(self::once())->method('requireOnce')->with('Foo-Bar')->willReturn('hello world!');
         $cache = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, 'PhpFrontend', $mockBackend);
         $result = $cache->requireOnce('Foo-Bar');
         self::assertSame('hello world!', $result);
@@ -83,7 +83,7 @@ class PhpFrontendTest extends UnitTestCase
     public function requireCallsTheBackendsRequireMethod()
     {
         $mockBackend = $this->createMock(\TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class);
-        $mockBackend->expects(self::once())->method('require')->with('Foo-Bar')->will(self::returnValue('hello world!'));
+        $mockBackend->expects(self::once())->method('require')->with('Foo-Bar')->willReturn('hello world!');
         $cache = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, 'PhpFrontend', $mockBackend);
         $result = $cache->require('Foo-Bar');
         self::assertSame('hello world!', $result);
index 1ee8051..4c32f8d 100644 (file)
@@ -33,7 +33,7 @@ class VariableFrontendTest extends UnitTestCase
             ->setMethods(['isValidEntryIdentifier'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cache->expects(self::once())->method('isValidEntryIdentifier')->with('foo')->will(self::returnValue(false));
+        $cache->expects(self::once())->method('isValidEntryIdentifier')->with('foo')->willReturn(false);
         $cache->set('foo', 'bar');
     }
 
@@ -95,7 +95,7 @@ class VariableFrontendTest extends UnitTestCase
             ->setMethods(['get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backend->expects(self::once())->method('get')->will(self::returnValue(serialize('Just some value')));
+        $backend->expects(self::once())->method('get')->willReturn(serialize('Just some value'));
 
         $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
         self::assertEquals('Just some value', $cache->get('VariableCacheTest'), 'The returned value was not the expected string.');
@@ -111,7 +111,7 @@ class VariableFrontendTest extends UnitTestCase
             ->setMethods(['get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backend->expects(self::once())->method('get')->will(self::returnValue(serialize($theArray)));
+        $backend->expects(self::once())->method('get')->willReturn(serialize($theArray));
 
         $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
         self::assertEquals($theArray, $cache->get('VariableCacheTest'), 'The returned value was not the expected unserialized array.');
@@ -126,7 +126,7 @@ class VariableFrontendTest extends UnitTestCase
             ->setMethods(['get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backend->expects(self::once())->method('get')->will(self::returnValue(serialize(false)));
+        $backend->expects(self::once())->method('get')->willReturn(serialize(false));
 
         $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
         self::assertFalse($cache->get('VariableCacheTest'), 'The returned value was not the FALSE.');
@@ -141,7 +141,7 @@ class VariableFrontendTest extends UnitTestCase
             ->setMethods(['get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'])
             ->disableOriginalConstructor()
             ->getMock();
-        $backend->expects(self::once())->method('has')->with(self::equalTo('VariableCacheTest'))->will(self::returnValue(true));
+        $backend->expects(self::once())->method('has')->with(self::equalTo('VariableCacheTest'))->willReturn(true);
 
         $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
         self::assertTrue($cache->has('VariableCacheTest'), 'has() did not return TRUE.');
@@ -158,7 +158,7 @@ class VariableFrontendTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->getMock();
 
-        $backend->expects(self::once())->method('remove')->with(self::equalTo($cacheIdentifier))->will(self::returnValue(true));
+        $backend->expects(self::once())->method('remove')->with(self::equalTo($cacheIdentifier))->willReturn(true);
 
         $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
         self::assertTrue($cache->remove($cacheIdentifier), 'remove() did not return TRUE');
index 6e50375..40da425 100644 (file)
@@ -45,12 +45,12 @@ class SendEmailCommandTest extends UnitTestCase
         $mailer
             ->expects(self::any())
             ->method('getTransport')
-            ->will(self::returnValue($delayedTransportProphecy->reveal()));
+            ->willReturn($delayedTransportProphecy->reveal());
 
         $mailer
             ->expects(self::any())
             ->method('getRealTransport')
-            ->will(self::returnValue($realTransportProphecy->reveal()));
+            ->willReturn($realTransportProphecy->reveal());
 
         /** @var SendEmailCommand|\PHPUnit_Framework_MockObject_MockObject $command */
         $command = $this->getMockBuilder(SendEmailCommand::class)
@@ -61,7 +61,7 @@ class SendEmailCommandTest extends UnitTestCase
         $command
             ->expects(self::any())
             ->method('getMailer')
-            ->will(self::returnValue($mailer));
+            ->willReturn($mailer);
 
         $tester = new CommandTester($command);
         $tester->execute([], []);
index ac8cbcd..3fa6576 100644 (file)
@@ -69,7 +69,7 @@ class ConfigurationManagerTest extends UnitTestCase
         $this->subject
             ->expects(self::once())
             ->method('getDefaultConfigurationFileLocation')
-            ->will(self::returnValue($defaultConfigurationFile));
+            ->willReturn($defaultConfigurationFile);
         $this->subject->getDefaultConfiguration();
     }
 
@@ -90,7 +90,7 @@ class ConfigurationManagerTest extends UnitTestCase
         $this->subject
             ->expects(self::once())
             ->method('getLocalConfigurationFileLocation')
-            ->will(self::returnValue($configurationFile));
+            ->willReturn($configurationFile);
         $this->subject->getLocalConfiguration();
     }
 
@@ -121,7 +121,7 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::once())
             ->method('writeLocalConfiguration')
             ->with($expectedConfiguration);
@@ -141,11 +141,11 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getDefaultConfiguration')
-            ->will(self::returnValue(
+            ->willReturn(
                 [
                     'path' => 'value',
                 ]
-            ));
+            );
 
         self::assertSame('value', $this->subject->getDefaultConfigurationValueByPath('path'));
     }
@@ -162,11 +162,11 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue(
+            ->willReturn(
                 [
                     'path' => 'value',
                 ]
-            ));
+            );
 
         self::assertSame('value', $this->subject->getLocalConfigurationValueByPath('path'));
     }
@@ -184,18 +184,18 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getDefaultConfiguration')
-            ->will(self::returnValue(
+            ->willReturn(
                 [
                     'path' => 'value',
                 ]
-            ));
+            );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue(
+            ->willReturn(
                 [
                     'path' => 'valueOverride',
                 ]
-            ));
+            );
 
         self::assertSame('valueOverride', $this->subject->getConfigurationValueByPath('path'));
     }
@@ -210,7 +210,7 @@ class ConfigurationManagerTest extends UnitTestCase
         ]);
         $this->subject->expects(self::once())
             ->method('isValidLocalConfigurationPath')
-            ->will(self::returnValue(false));
+            ->willReturn(false);
 
         self::assertFalse($this->subject->setLocalConfigurationValueByPath('path', 'value'));
     }
@@ -238,10 +238,10 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('isValidLocalConfigurationPath')
-            ->will(self::returnValue(true));
+            ->willReturn(true);
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::once())
             ->method('writeLocalConfiguration')
             ->with($expectedConfiguration);
@@ -273,10 +273,10 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::any())
             ->method('isValidLocalConfigurationPath')
-            ->will(self::returnValue(true));
+            ->willReturn(true);
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::once())
             ->method('writeLocalConfiguration')
             ->with($expectedConfiguration);
@@ -310,7 +310,7 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::once())
             ->method('writeLocalConfiguration')
             ->with($expectedConfiguration);
@@ -338,7 +338,7 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::never())
             ->method('writeLocalConfiguration');
 
@@ -362,7 +362,7 @@ class ConfigurationManagerTest extends UnitTestCase
         );
         $this->subject->expects(self::once())
             ->method('getLocalConfiguration')
-            ->will(self::returnValue($currentLocalConfiguration));
+            ->willReturn($currentLocalConfiguration);
         $this->subject->expects(self::never())
             ->method('writeLocalConfiguration');
 
@@ -448,7 +448,7 @@ class ConfigurationManagerTest extends UnitTestCase
         $this->subject
             ->expects(self::any())
             ->method('getLocalConfigurationFileLocation')
-            ->will(self::returnValue($configurationFile));
+            ->willReturn($configurationFile);
 
         $pairs = [
             'foo' => 42,
index 090bb51..25598e6 100644 (file)
@@ -463,19 +463,19 @@ class DataHandlerTest extends UnitTestCase
         $cacheManagerMock->expects(self::once())->method('flushCachesInGroupByTags')->with('pages', []);
 
         $subject->expects(self::once())->method('getCacheManager')->willReturn($cacheManagerMock);
-        $subject->expects(self::once())->method('recordInfo')->will(self::returnValue(null));
-        $subject->expects(self::once())->method('checkModifyAccessList')->with('pages')->will(self::returnValue(true));
-        $subject->expects(self::once())->method('tableReadOnly')->with('pages')->will(self::returnValue(false));
-        $subject->expects(self::once())->method('checkRecordUpdateAccess')->will(self::returnValue(true));
+        $subject->expects(self::once())->method('recordInfo')->willReturn(null);
+        $subject->expects(self::once())->method('checkModifyAccessList')->with('pages')->willReturn(true);
+        $subject->expects(self::once())->method('tableReadOnly')->with('pages')->willReturn(false);
+        $subject->expects(self::once())->method('checkRecordUpdateAccess')->willReturn(true);
         $subject->expects(self::once())->method('unsetElementsToBeDeleted')->willReturnArgument(0);
 
         /** @var BackendUserAuthentication|\PHPUnit_Framework_MockObject_MockObject $backEndUser */
         $backEndUser = $this->createMock(BackendUserAuthentication::class);
         $backEndUser->workspace = 1;
         $backEndUser->workspaceRec = ['freeze' => false];
-        $backEndUser->expects(self::once())->method('workspaceAllowAutoCreation')->will(self::returnValue(true));
-        $backEndUser->expects(self::once())->method('workspaceCannotEditRecord')->will(self::returnValue(true));
-        $backEndUser->expects(self::once())->method('recordEditAccessInternals')->with('pages', 1)->will(self::returnValue(true));
+        $backEndUser->expects(self::once())->method('workspaceAllowAutoCreation')->willReturn(true);
+        $backEndUser->expects(self::once())->method('workspaceCannotEditRecord')->willReturn(true);
+        $backEndUser->expects(self::once())->method('recordEditAccessInternals')->with('pages', 1)->willReturn(true);
         $subject->BE_USER = $backEndUser;
         $createdDataHandler = $this->createMock(DataHandler::class);
         $createdDataHandler->expects(self::once())->method('start')->with([], [
@@ -873,8 +873,8 @@ class DataHandlerTest extends UnitTestCase
 
         /** @var DataHandler|\PHPUnit_Framework_MockObject_MockObject|AccessibleObjectInterface $mockDataHandler */
         $mockDataHandler = $this->getAccessibleMock(DataHandler::class, ['getInlineFieldType', 'deleteAction', 'createRelationHandlerInstance'], [], '', false);
-        $mockDataHandler->expects(self::once())->method('getInlineFieldType')->will(self::returnValue('field'));
-        $mockDataHandler->expects(self::once())->method('createRelationHandlerInstance')->will(self::returnValue($mockRelationHandler));
+        $mockDataHandler->expects(self::once())->method('getInlineFieldType')->willReturn('field');
+        $mockDataHandler->expects(self::once())->method('createRelationHandlerInstance')->willReturn($mockRelationHandler);
         $mockDataHandler->expects(self::never())->method('deleteAction');
         $mockDataHandler->deleteRecord_procBasedOnFieldType($table, 42, 'foo', 'bar', $conf);
     }
index f110cbd..e1f9c4a 100644 (file)
@@ -69,14 +69,14 @@ class ConnectionTest extends UnitTestCase
 
         $this->connection->expects(self::any())
             ->method('getExpressionBuilder')
-            ->will(self::returnValue(GeneralUtility::makeInstance(ExpressionBuilder::class, $this->connection)));
+            ->willReturn(GeneralUtility::makeInstance(ExpressionBuilder::class, $this->connection));
 
         $this->connection->expects(self::any())
             ->method('connect');
 
         $this->connection->expects(self::any())
             ->method('getDatabasePlatform')
-            ->will(self::returnValue(new MockPlatform()));
+            ->willReturn(new MockPlatform());
     }
 
     /**
@@ -216,7 +216,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeUpdate')
             ->with($expectedQuery, $expectedValues, $expectedTypes)
-            ->will(self::returnValue(1));
+            ->willReturn(1);
 
         $this->connection->insert(...$args);
     }
@@ -229,7 +229,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeUpdate')
             ->with('INSERT INTO "aTestTable" ("aField") VALUES (?), (?)', ['aValue', 'anotherValue'])
-            ->will(self::returnValue(2));
+            ->willReturn(2);
 
         $this->connection->bulkInsert('aTestTable', [['aField' => 'aValue'], ['aField' => 'anotherValue']], ['aField']);
     }
@@ -280,7 +280,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeUpdate')
             ->with($expectedQuery, $expectedValues, $expectedTypes)
-            ->will(self::returnValue(1));
+            ->willReturn(1);
 
         $this->connection->update(...$args);
     }
@@ -331,7 +331,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeUpdate')
             ->with($expectedQuery, $expectedValues, $expectedTypes)
-            ->will(self::returnValue(1));
+            ->willReturn(1);
 
         $this->connection->delete(...$args);
     }
@@ -415,7 +415,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeQuery')
             ->with($expectedQuery, $expectedParameters)
-            ->will(self::returnValue($resultStatement));
+            ->willReturn($resultStatement);
 
         $this->connection->select(...$args);
     }
@@ -465,12 +465,12 @@ class ConnectionTest extends UnitTestCase
         $resultStatement->expects(self::once())
             ->method('fetchColumn')
             ->with(0)
-            ->will(self::returnValue(0));
+            ->willReturn(0);
 
         $this->connection->expects(self::once())
             ->method('executeQuery')
             ->with($expectedQuery, $expectedParameters)
-            ->will(self::returnValue($resultStatement));
+            ->willReturn($resultStatement);
 
         $this->connection->count(...$args);
     }
@@ -483,7 +483,7 @@ class ConnectionTest extends UnitTestCase
         $this->connection->expects(self::once())
             ->method('executeUpdate')
             ->with('TRUNCATE "aTestTable"')
-            ->will(self::returnValue(0));
+            ->willReturn(0);
 
         $this->connection->truncate('aTestTable', false);
     }
index 6143cba..8b99e3c 100644 (file)
@@ -48,10 +48,10 @@ class BulkInsertTest extends UnitTestCase
 
         $this->connection->expects(self::any())
             ->method('quoteIdentifier')
-            ->will(self::returnArgument(0));
+            ->willReturnArgument(0);
         $this->connection->expects(self::any())
             ->method('getDatabasePlatform')
-            ->will(self::returnValue(new MockPlatform()));
+            ->willReturn(new MockPlatform());
     }
 
     /**
@@ -332,7 +332,7 @@ class BulkInsertTest extends UnitTestCase
 
         $subject->expects(self::any())
             ->method('getInsertMaxRows')
-            ->will(self::returnValue(10));
+            ->willReturn(10);
 
         for ($i = 0; $i <= 10; $i++) {
             $subject->addValues([]);
index 2781795..948cd6b 100644 (file)
@@ -62,7 +62,7 @@ class RelationHandlerTest extends UnitTestCase
         $this->subject->expects(self::once())
             ->method('purgeVersionedIds')
             ->with('sys_category', [1, 2, 3])
-            ->will(self::returnValue([2]));
+            ->willReturn([2]);
 
         self::assertTrue($this->subject->purgeItemArray(0));
     }
index ae9554b..79afc7e 100644 (file)
@@ -55,7 +55,7 @@ class PageRepositoryTest extends UnitTestCase
         parent::setUp();
         $this->pageSelectObject = $this->getAccessibleMock(PageRepository::class, ['getMultipleGroupsWhereClause'], [], '', false);
         $this->pageSelectObject->_set('context', new Context());
-        $this->pageSelectObject->expects(self::any())->method('getMultipleGroupsWhereClause')->will(self::returnValue(' AND 1=1'));
+        $this->pageSelectObject->expects(self::any())->method('getMultipleGroupsWhereClause')->willReturn(' AND 1=1');
     }
 
     ///////////////////////////////
index 72cbcaf..52ba68d 100644 (file)
@@ -36,7 +36,7 @@ class ProductionExceptionHandlerTest extends UnitTestCase
             ->setMethods(['discloseExceptionInformation', 'sendStatusHeaders', 'writeLogEntries'])
             ->disableOriginalConstructor()
             ->getMock();
-        $this->subject->expects(self::any())->method('discloseExceptionInformation')->will(self::returnValue(true));
+        $this->subject->expects(self::any())->method('discloseExceptionInformation')->willReturn(true);
     }
 
     /**
@@ -65,7 +65,7 @@ class ProductionExceptionHandlerTest extends UnitTestCase
             ->setMethods(['getTitle'])
             ->setConstructorArgs(['some message'])
             ->getMock();
-        $exception->expects(self::any())->method('getTitle')->will(self::returnValue($title));
+        $exception->expects(self::any())->method('getTitle')->willReturn($title);
         ob_start();
         $this->subject->echoExceptionWeb($exception);
         $output = ob_get_contents();
index 059f281..f893393 100644 (file)
@@ -45,7 +45,7 @@ class AbstractFormProtectionTest extends UnitTestCase
         $subject = $this->getMockBuilder(FormProtectionTesting::class)
             ->setMethods(['retrieveSessionToken'])
             ->getMock();
-        $subject->expects(self::once())->method('retrieveSessionToken')->will(self::returnValue('token'));
+        $subject->expects(self::once())->method('retrieveSessionToken')->willReturn('token');
         $subject->generateToken('foo');
         $subject->generateToken('foo');
     }
@@ -58,7 +58,7 @@ class AbstractFormProtectionTest extends UnitTestCase
         $subject = $this->getMockBuilder(FormProtectionTesting::class)
             ->setMethods(['retrieveSessionToken'])
             ->getMock();
-        $subject->expects(self::once())->method('retrieveSessionToken')->will(self::returnValue('token'));
+        $subject->expects(self::once())->method('retrieveSessionToken')->willReturn('token');
         $subject->validateToken('foo', 'bar');
         $subject->validateToken('foo', 'bar');
     }
index 7c89aee..b0e9e61 100644 (file)
@@ -66,7 +66,7 @@ class BackendFormProtectionTest extends UnitTestCase
             ->expects(self::once())
             ->method('getSessionData')
             ->with('formProtectionSessionToken')
-            ->will(self::returnValue([]));
+            ->willReturn([]);
         $this->subject->generateToken('foo');
     }
 
@@ -88,7 +88,7 @@ class BackendFormProtectionTest extends UnitTestCase
             ->expects(self::atLeastOnce())
             ->method('getSessionData')
             ->with('formProtectionSessionToken')
-            ->will(self::returnValue($sessionToken));
+            ->willReturn($sessionToken);
 
         self::assertTrue(
             $this->subject->validateToken($tokenId, $formName, $action, $formInstanceName)
index 0a6d4ca..bee3d6b 100644 (file)
@@ -579,8 +579,8 @@ class IconFactoryTest extends UnitTestCase
         $mockedFile = $this->getMockBuilder(File::class)
             ->setConstructorArgs([['identifier' => '', 'name' => ''], $mockedStorage])
             ->getMock();
-        $mockedFile->expects(self::atMost(1))->method('getExtension')->will(self::returnValue($extension));
-        $mockedFile->expects(self::atLeastOnce())->method('getMimeType')->will(self::returnValue($mimeType));
+        $mockedFile->expects(self::atMost(1))->method('getExtension')->willReturn($extension);
+        $mockedFile->expects(self::atLeastOnce())->method('getMimeType')->willReturn($mimeType);
         return $mockedFile;
     }
 
@@ -593,11 +593,11 @@ class IconFactoryTest extends UnitTestCase
     protected function getTestSubjectFolderObject($identifier)
     {
         $mockedStorage = $this->createMock(ResourceStorage::class);
-        $mockedStorage->expects(self::any())->method('getRootLevelFolder')->will(self::returnValue(
+        $mockedStorage->expects(self::any())->method('getRootLevelFolder')->willReturn(
             new Folder($mockedStorage, '/', '/')
-        ));
-        $mockedStorage->expects(self::any())->method('checkFolderActionPermission')->will(self::returnValue(true));
-        $mockedStorage->expects(self::any())->method('isBrowsable')->will(self::returnValue(true));
+        );
+        $mockedStorage->expects(self::any())->method('checkFolderActionPermission')->willReturn(true);
+        $mockedStorage->expects(self::any())->method('isBrowsable')->willReturn(true);
         return new Folder($mockedStorage, $identifier, $identifier);
     }
 }
index bfce56e..93aa1ff 100644 (file)
@@ -95,7 +95,7 @@ class LoggerTest extends UnitTestCase
         $processor = $this->getMockBuilder(NullProcessor::class)
             ->setMethods(['processLogRecord'])
             ->getMock();
-        $processor->expects(self::once())->method('processLogRecord')->will(self::returnValue(new LogRecord($component, $level, $message)));
+        $processor->expects(self::once())->method('processLogRecord')->willReturn(new LogRecord($component, $level, $message));
         $logger->addProcessor($level, $processor);
         // we need a writer, otherwise we will not process log records
         $logger->addWriter($level, new NullWriter());
index f157c24..c472e56 100644 (file)
@@ -73,7 +73,7 @@ class IntrospectionProcessorTest extends UnitTestCase
      */
     public function introspectionProcessorAddsLastBacktraceItemToLogRecord()
     {
-        $this->processor->expects(self::any())->method('getDebugBacktrace')->will(self::returnValue($this->dummyBacktrace));
+        $this->processor->expects(self::any())->method('getDebugBacktrace')->willReturn($this->dummyBacktrace);
         $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
         $logRecord = $this->processor->processLogRecord($logRecord);
 
@@ -104,7 +104,7 @@ class IntrospectionProcessorTest extends UnitTestCase
                 'function' => 'function888'
             ]
         );
-        $this->processor->expects(self::any())->method('getDebugBacktrace')->will(self::returnValue($dummyBacktrace));
+        $this->processor->expects(self::any())->method('getDebugBacktrace')->willReturn($dummyBacktrace);
 
         $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
         $logRecord = $this->processor->processLogRecord($logRecord);
@@ -133,7 +133,7 @@ class IntrospectionProcessorTest extends UnitTestCase
      */
     public function introspectionProcessorShiftsGivenNumberOfEntriesFromBacktrace($number)
     {
-        $this->processor->expects(self::any())->method('getDebugBacktrace')->will(self::returnValue($this->dummyBacktrace));
+        $this->processor->expects(self::any())->method('getDebugBacktrace')->willReturn($this->dummyBacktrace);
         $this->processor->setShiftBackTraceLevel($number);
 
         $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
@@ -150,7 +150,7 @@ class IntrospectionProcessorTest extends UnitTestCase
      */
     public function introspectionProcessorLeavesOneEntryIfGivenNumberOfEntriesFromBacktraceIsGreaterOrEqualNumberOfBacktraceLevels()
     {
-        $this->processor->expects(self::any())->method('getDebugBacktrace')->will(self::returnValue($this->dummyBacktrace));
+        $this->processor->expects(self::any())->method('getDebugBacktrace')->willReturn($this->dummyBacktrace);
         $this->processor->setShiftBackTraceLevel(4);
 
         $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
@@ -167,7 +167,7 @@ class IntrospectionProcessorTest extends UnitTestCase
      */
     public function appendFullBacktraceAddsTheFullBacktraceAsStringToTheLog()
     {
-        $this->processor->expects(self::any())->method('getDebugBacktrace')->will(self::returnValue($this->dummyBacktrace));
+        $this->processor->expects(self::any())->method('getDebugBacktrace')->willReturn($this->dummyBacktrace);
 
         $this->processor->setAppendFullBackTrace(true);
 
index 3a05506..314d3b7 100644 (file)
@@ -51,10 +51,10 @@ class PackageManagerTest extends UnitTestCase
             ->setMethods(['has', 'set', 'getBackend', 'getCacheDirectory'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockCache->expects(self::any())->method('has')->will(self::returnValue(false));
-        $mockCache->expects(self::any())->method('set')->will(self::returnValue(true));
-        $mockCache->expects(self::any())->method('getBackend')->will(self::returnValue($mockCacheBackend));
-        $mockCacheBackend->expects(self::any())->method('getCacheDirectory')->will(self::returnValue('vfs://Test/Cache'));
+        $mockCache->expects(self::any())->method('has')->willReturn(false);
+        $mockCache->expects(self::any())->method('set')->willReturn(true);
+        $mockCache->expects(self::any())->method('getBackend')->willReturn($mockCacheBackend);
+        $mockCacheBackend->expects(self::any())->method('getCacheDirectory')->willReturn('vfs://Test/Cache');
         $this->packageManager = $this->getAccessibleMock(
             PackageManager::class,
             ['sortAndSavePackageStates', 'sortActivePackagesByDependencies', 'registerTransientClassLoadingInformationForPackage'],
@@ -277,7 +277,7 @@ class PackageManagerTest extends UnitTestCase
 
         $this->createPackage($packageKey);
 
-        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->will(self::returnValue([]));
+        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
 
         $this->packageManager->deactivatePackage($packageKey);
         self::assertFalse($this->packageManager->isPackageActive($packageKey));
@@ -300,7 +300,7 @@ class PackageManagerTest extends UnitTestCase
 
         $package = $this->createPackage('Acme.YetAnotherTestPackage');
         $package->setProtected(true);
-        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->will(self::returnValue([]));
+        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
         $this->packageManager->deactivatePackage('Acme.YetAnotherTestPackage');
     }
 
@@ -315,7 +315,7 @@ class PackageManagerTest extends UnitTestCase
         $this->expectException(UnknownPackageException::class);
         $this->expectExceptionCode(1166543253);
 
-        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->will(self::returnValue([]));
+        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
         $this->packageManager->deletePackage('PrettyUnlikelyThatThisPackageExists');
     }
 
@@ -347,7 +347,7 @@ class PackageManagerTest extends UnitTestCase
     {
         $this->createPackage('Acme.YetAnotherTestPackage');
 
-        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->will(self::returnValue([]));
+        $this->packageManager->expects(self::any())->method('sortActivePackagesByDependencies')->willReturn([]);
 
         self::assertTrue($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'));
         self::assertTrue($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'));
index c0a8a0f..661a6f1 100644 (file)
@@ -45,8 +45,8 @@ class AbstractFileTest extends UnitTestCase
             ->setMethods(['getFolderIdentifierFromFileIdentifier', 'getFolder'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockedStorage->expects(self::once())->method('getFolderIdentifierFromFileIdentifier')->with($currentIdentifier)->will(self::returnValue($parentIdentifier));
-        $mockedStorage->expects(self::once())->method('getFolder')->with($parentIdentifier)->will(self::returnValue($parentFolderFixture));
+        $mockedStorage->expects(self::once())->method('getFolderIdentifierFromFileIdentifier')->with($currentIdentifier)->willReturn($parentIdentifier);
+        $mockedStorage->expects(self::once())->method('getFolder')->with($parentIdentifier)->willReturn($parentFolderFixture);
 
         /** @var AbstractFile $currentFolderFixture */
         $currentFolderFixture = $this->getMockForAbstractClass(AbstractFile::class);
index a50b26d..864528e 100644 (file)
@@ -120,8 +120,8 @@ abstract class BaseTestCase extends UnitTestCase
             ->setMethods($mockedMethods)
             ->disableOriginalConstructor()
             ->getMock();
-        $mock->expects(self::any())->method('getIdentifier')->will(self::returnValue($identifier));
-        $mock->expects(self::any())->method('getName')->will(self::returnValue(basename($identifier)));
+        $mock->expects(self::any())->method('getIdentifier')->willReturn($identifier);
+        $mock->expects(self::any())->method('getName')->willReturn(basename($identifier));
         return $mock;
     }
 
@@ -161,8 +161,8 @@ abstract class BaseTestCase extends UnitTestCase
     protected function getFolderMock($identifier, $mockedMethods = [], $subfolders = [], $files = [])
     {
         $folder = $this->_createFileFolderMock(\TYPO3\CMS\Core\Resource\Folder::class, $identifier, array_merge($mockedMethods, ['getFiles', 'getSubfolders']));
-        $folder->expects(self::any())->method('getSubfolders')->will(self::returnValue($subfolders));
-        $folder->expects(self::any())->method('getFiles')->will(self::returnValue($files));
+        $folder->expects(self::any())->method('getSubfolders')->willReturn($subfolders);
+        $folder->expects(self::any())->method('getFiles')->willReturn($files);
         return $folder;
     }
 }
index dea00b2..ece505f 100644 (file)
@@ -133,8 +133,8 @@ class LocalDriverTest extends BaseTestCase
         );
         $driver->expects(self::any())
             ->method('isPathValid')
-            ->will(
-                self::returnValue(true)
+            ->willReturn(
+                true
             );
 
         $driver->setStorageUid(5);
@@ -189,8 +189,8 @@ class LocalDriverTest extends BaseTestCase
         $driver = $this->createDriver([], ['sanitizeFilename']);
         $driver->expects(self::exactly(2))
             ->method('sanitizeFileName')
-            ->will(
-                self::returnValue('sanitized')
+            ->willReturn(
+                'sanitized'
             );
         $driver->createFolder('newFolder/andSubfolder', '/', true);
         self::assertFileExists($this->getUrlInMount('/sanitized/sanitized/'));
@@ -212,8 +212,8 @@ class LocalDriverTest extends BaseTestCase
         $driver->expects(self::once())
             ->method('hasCapability')
             ->with(ResourceStorage::CAPABILITY_PUBLIC)
-            ->will(
-                self::returnValue(true)
+            ->willReturn(
+                true
             );
         $driver->_set('absoluteBasePath', Environment::getPublicPath() . '/un encö/ded %path/');
         $driver->_call('determineBaseUrl');
index 71d84d8..af518fb 100644 (file)
@@ -32,8 +32,8 @@ class FileReferenceTest extends UnitTestCase
         $originalFileMock = $this->getAccessibleMock(\TYPO3\CMS\Core\Resource\File::class, [], [], '', false);
         $originalFileMock->expects(self::any())
             ->method('getProperties')
-            ->will(
-                self::returnValue($originalFileProperties)
+            ->willReturn(
+                $originalFileProperties
             );
         $fixture->_set('originalFile', $originalFileMock);
         $fixture->_set('propertiesOfFileReference', $fileReferenceProperties);
index ce0a9d0..5285fc9 100644 (file)
@@ -41,10 +41,10 @@ class FileTest extends UnitTestCase
     {
         parent::setUp();
         $this->storageMock = $this->createMock(ResourceStorage::class);
-        $this->storageMock->expects(self::any())->method('getUid')->will(self::returnValue(5));
+        $this->storageMock->expects(self::any())->method('getUid')->willReturn(5);
 
         $mockedMetaDataRepository = $this->createMock(MetaDataRepository::class);
-        $mockedMetaDataRepository->expects(self::any())->method('findByFile')->will(self::returnValue(['file' => 1]));
+        $mockedMetaDataRepository->expects(self::any())->method('findByFile')->willReturn(['file' => 1]);
         GeneralUtility::setSingletonInstance(MetaDataRepository::class, $mockedMetaDataRepository);
     }
 
@@ -165,7 +165,7 @@ class FileTest extends UnitTestCase
         $mockedResourceFactory
             ->expects(self::once())
             ->method('getStorageObject')
-            ->will(self::returnValue($mockedNewStorage));
+            ->willReturn($mockedNewStorage);
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Resource\ResourceFactory::class, $mockedResourceFactory);
 
         $subject->updateProperties(['storage' => 'different']);
@@ -179,7 +179,7 @@ class FileTest extends UnitTestCase
     {
         $targetStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class);
         $targetFolder = $this->createMock(\TYPO3\CMS\Core\Resource\Folder::class);
-        $targetFolder->expects(self::any())->method('getStorage')->will(self::returnValue($targetStorage));
+        $targetFolder->expects(self::any())->method('getStorage')->willReturn($targetStorage);
         $fixture = new File([], $this->storageMock);
         $targetStorage->expects(self::once())->method('copyFile')->with(self::equalTo($fixture), self::equalTo($targetFolder));
         $fixture->copyTo($targetFolder);
@@ -192,7 +192,7 @@ class FileTest extends UnitTestCase
     {
         $targetStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class);
         $targetFolder = $this->createMock(\TYPO3\CMS\Core\Resource\Folder::class);
-        $targetFolder->expects(self::any())->method('getStorage')->will(self::returnValue($targetStorage));
+        $targetFolder->expects(self::any())->method('getStorage')->willReturn($targetStorage);
         $fixture = new File([], $this->storageMock);
         $targetStorage->expects(self::once())->method('moveFile')->with(self::equalTo($fixture), self::equalTo($targetFolder));
         $fixture->moveTo($targetFolder);
index 4296139..013130a 100644 (file)
@@ -84,7 +84,7 @@ class FolderTest extends UnitTestCase
     public function getFilesReturnsArrayWithFilenamesAsKeys()
     {
         $mockedStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class);
-        $mockedStorage->expects(self::once())->method('getFilesInFolder')->will(self::returnValue(
+        $mockedStorage->expects(self::once())->method('getFilesInFolder')->willReturn(
             [
                 'somefile.png' => [
                     'name' => 'somefile.png'
@@ -93,7 +93,7 @@ class FolderTest extends UnitTestCase
                     'name' => 'somefile.jpg'
                 ]
             ]
-        ));
+        );
         $fixture = $this->createFolderFixture('/somePath', 'someName', $mockedStorage);
 
         $fileList = $fixture->getFiles();
@@ -111,7 +111,7 @@ class FolderTest extends UnitTestCase
             ->expects(self::once())
             ->method('getFilesInFolder')
             ->with(self::anything(), self::anything(), self::anything(), self::anything(), false)
-            ->will(self::returnValue([]));
+            ->willReturn([]);
 
         $fixture = $this->createFolderFixture('/somePath', 'someName', $mockedStorage);
         $fixture->getFiles();
@@ -127,7 +127,7 @@ class FolderTest extends UnitTestCase
             ->expects(self::once())
             ->method('getFilesInFolder')
             ->with(self::anything(), self::anything(), self::anything(), self::anything(), true)
-            ->will(self::returnValue([]));
+            ->willReturn([]);
 
         $fixture = $this->createFolderFixture('/somePath', 'someName', $mockedStorage);
         $fixture->getFiles(0, 0, \TYPO3\CMS\Core\Resource\Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, true);
@@ -139,7 +139,7 @@ class FolderTest extends UnitTestCase
     public function getSubfolderCallsFactoryWithCorrectArguments()
     {
         $mockedStorage = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class);
-        $mockedStorage->expects(self::once())->method('hasFolderInFolder')->with(self::equalTo('someSubfolder'))->will(self::returnValue(true));
+        $mockedStorage->expects(self::once())->method('hasFolderInFolder')->with(self::equalTo('someSubfolder'))->willReturn(true);
         /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Resource\ResourceFactory $mockedFactory */
         $mockedFactory = $this->createMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class);
         $folderFixture = $this->createFolderFixture(
@@ -152,7 +152,7 @@ class FolderTest extends UnitTestCase
             'someSubfolder',
             $mockedStorage
         );
-        $mockedStorage->expects(self::once())->method('getFolderInFolder')->will(self::returnValue($subfolderFixture));
+        $mockedStorage->expects(self::once())->method('getFolderInFolder')->willReturn($subfolderFixture);
         \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(
             \TYPO3\CMS\Core\Resource\ResourceFactory::class,
             $mockedFactory
@@ -173,8 +173,8 @@ class FolderTest extends UnitTestCase
             ->setMethods(['getFolderIdentifierFromFileIdentifier', 'getFolder'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockedStorage->expects(self::once())->method('getFolderIdentifierFromFileIdentifier')->with($currentIdentifier)->will(self::returnValue($parentIdentifier));
-        $mockedStorage->expects(self::once())->method('getFolder')->with($parentIdentifier)->will(self::returnValue($parentFolderFixture));
+        $mockedStorage->expects(self::once())->method('getFolderIdentifierFromFileIdentifier')->with($currentIdentifier)->willReturn($parentIdentifier);
+        $mockedStorage->expects(self::once())->method('getFolder')->with($parentIdentifier)->willReturn($parentFolderFixture);
 
         $currentFolderFixture = $this->createFolderFixture($currentIdentifier, 'current', $mockedStorage);
 
index 65cb554..f08e9d8 100644 (file)
@@ -72,19 +72,19 @@ class ExtractorRegistryTest extends UnitTestCase
         $extractorObject1 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class)
             ->setMockClassName($extractorClass1)
             ->getMock();
-        $extractorObject1->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $extractorObject1->expects(self::any())->method('getPriority')->willReturn(1);
 
         $extractorClass2 = 'ad9195e2487eea33c8a2abd5cf33cba4';
         $extractorObject2 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class)
             ->setMockClassName($extractorClass2)
             ->getMock();
-        $extractorObject2->expects(self::any())->method('getPriority')->will(self::returnValue(10));
+        $extractorObject2->expects(self::any())->method('getPriority')->willReturn(10);
 
         $extractorClass3 = 'cef9aa4e1cd3aa7ff05dcdccb117156a';
         $extractorObject3 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class)
             ->setMockClassName($extractorClass3)
             ->getMock();
-        $extractorObject3->expects(self::any())->method('getPriority')->will(self::returnValue(2));
+        $extractorObject3->expects(self::any())->method('getPriority')->willReturn(2);
 
         $createdExtractorInstances = [
             [$extractorClass1, $extractorObject1],
@@ -113,13 +113,13 @@ class ExtractorRegistryTest extends UnitTestCase
         $extractorObject1 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class)
             ->setMockClassName($extractorClass1)
             ->getMock();
-        $extractorObject1->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $extractorObject1->expects(self::any())->method('getPriority')->willReturn(1);
 
         $extractorClass2 = 'ac318f1659d278b79b38262f23a78d5d';
         $extractorObject2 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Index\ExtractorInterface::class)
             ->setMockClassName($extractorClass2)
             ->getMock();
-        $extractorObject2->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $extractorObject2->expects(self::any())->method('getPriority')->willReturn(1);
 
         $createdExtractorInstances = [
             [$extractorClass1, $extractorObject1],
@@ -150,7 +150,7 @@ class ExtractorRegistryTest extends UnitTestCase
         if (!empty($createsExtractorInstances)) {
             $extractorRegistry->expects(self::any())
                 ->method('createExtractorInstance')
-                ->will(self::returnValueMap($createsExtractorInstances));
+                ->willReturnMap($createsExtractorInstances);
         }
 
         return $extractorRegistry;
index 382a85f..fd01efc 100644 (file)
@@ -45,7 +45,7 @@ class MetaDataAspectTest extends UnitTestCase
     {
         parent::setUp();
         $this->storageMock = $this->createMock(ResourceStorage::class);
-        $this->storageMock->expects(self::any())->method('getUid')->will(self::returnValue(12));
+        $this->storageMock->expects(self::any())->method('getUid')->willReturn(12);
     }
 
     /**
index daac3e2..a7c5ae1 100644 (file)
@@ -64,7 +64,7 @@ class VimeoHelperTest extends UnitTestCase
 
         $this->subject->expects(self::any())->method('transformMediaIdToFile')
             ->with($videoId, $mockedFolder, $this->extension)
-            ->will(self::returnValue($expectedResult));
+            ->willReturn($expectedResult);
 
         $result = $this->subject->transformUrlToFile($url . $videoId, $mockedFolder);
 
index 78c0e9a..94709e4 100644 (file)
@@ -53,7 +53,7 @@ class ProcessedFileTest extends UnitTestCase
     {
         parent::setUp();
         $this->storageMock = $this->createMock(ResourceStorage::class);
-        $this->storageMock->expects(self::any())->method('getUid')->will(self::returnValue(5));
+        $this->storageMock->expects(self::any())->method('getUid')->willReturn(5);
 
         $this->folderMock = $this->createMock(Folder::class);
         $this->folderMock->expects(self::any())->method('getStorage')->willReturn($this->storageMock);
index 598c5c0..a48f642 100644 (file)
@@ -31,10 +31,10 @@ class LocalPreviewHelperTest extends UnitTestCase
     {
         $file = $this->createMock(File::class);
         // Use size slightly larger than default size to ensure processing
-        $file->expects(self::any())->method('getProperty')->will(self::returnValueMap([
+        $file->expects(self::any())->method('getProperty')->willReturnMap([
             ['width', 65],
             ['height', 65],
-        ]));
+        ]);
 
         $task = $this->createMock(TaskInterface::class);
         $task->expects(self::once())->method('getSourceFile')->willReturn($file);
@@ -58,10 +58,10 @@ class LocalPreviewHelperTest extends UnitTestCase
     public function processDoesNotScaleUpImages()
     {
         $file = $this->createMock(File::class);
-        $file->expects(self::any())->method('getProperty')->will(self::returnValueMap([
+        $file->expects(self::any())->method('getProperty')->willReturnMap([
             ['width', 20],
             ['height', 20],
-        ]));
+        ]);
 
         $localPreviewHelper = $this->getMockBuilder(LocalPreviewHelper::class)
             ->disableOriginalConstructor()
@@ -81,10 +81,10 @@ class LocalPreviewHelperTest extends UnitTestCase
     public function processGeneratesPreviewEvenIfSourceFileHasNoSize()
     {
         $file = $this->createMock(File::class);
-        $file->expects(self::any())->method('getProperty')->will(self::returnValueMap([
+        $file->expects(self::any())->method('getProperty')->willReturnMap([
             ['width', 0],
             ['height', 0],
-        ]));
+        ]);
 
         $task = $this->createMock(TaskInterface::class);
         $task->expects(self::once())->method('getSourceFile')->willReturn($file);
index 450dccd..7c97bd4 100644 (file)
@@ -42,11 +42,11 @@ class AudioTagRendererTest extends UnitTestCase
         $audioTagRenderer = new AudioTagRenderer();
 
         $fileResourceMock1 = $this->createMock(File::class);
-        $fileResourceMock1->expects(self::any())->method('getMimeType')->will(self::returnValue('audio/mpeg'));
+        $fileResourceMock1->expects(self::any())->method('getMimeType')->willReturn('audio/mpeg');
         $fileResourceMock2 = $this->createMock(File::class);
-        $fileResourceMock2->expects(self::any())->method('getMimeType')->will(self::returnValue('audio/wav'));
+        $fileResourceMock2->expects(self::any())->method('getMimeType')->willReturn('audio/wav');
         $fileResourceMock3 = $this->createMock(File::class);
-        $fileResourceMock3->expects(self::any())->method('getMimeType')->will(self::returnValue('audio/ogg'));
+        $fileResourceMock3->expects(self::any())->method('getMimeType')->willReturn('audio/ogg');
 
         self::assertTrue($audioTagRenderer->canRender($fileResourceMock1));
         self::assertTrue($audioTagRenderer->canRender($fileResourceMock2));
@@ -61,7 +61,7 @@ class AudioTagRendererTest extends UnitTestCase
         $audioTagRenderer = new AudioTagRenderer();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/mp4'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/mp4');
 
         self::assertFalse($audioTagRenderer->canRender($fileResourceMock));
     }
@@ -128,8 +128,8 @@ class AudioTagRendererTest extends UnitTestCase
         $audioTagRenderer = new AudioTagRenderer();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('audio/mpeg'));
-        $fileResourceMock->expects(self::any())->method('getPublicUrl')->will(self::returnValue($url));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('audio/mpeg');
+        $fileResourceMock->expects(self::any())->method('getPublicUrl')->willReturn($url);
 
         self::assertSame(
             $expected,
index 9b9f6a6..d1e9a11 100644 (file)
@@ -39,7 +39,7 @@ class RendererRegistryTest extends UnitTestCase
         if (!empty($createsRendererInstances)) {
             $rendererRegistry->expects(self::any())
                 ->method('createRendererInstance')
-                ->will(self::returnValueMap($createsRendererInstances));
+                ->willReturnMap($createsRendererInstances);
         }
 
         return $rendererRegistry;
@@ -95,19 +95,19 @@ class RendererRegistryTest extends UnitTestCase
         $rendererObject1 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMockClassName($rendererClass1)
             ->getMock();
-        $rendererObject1->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $rendererObject1->expects(self::any())->method('getPriority')->willReturn(1);
 
         $rendererClass2 = $this->getUniqueId('myRenderer2');
         $rendererObject2 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMockClassName($rendererClass2)
             ->getMock();
-        $rendererObject2->expects(self::any())->method('getPriority')->will(self::returnValue(10));
+        $rendererObject2->expects(self::any())->method('getPriority')->willReturn(10);
 
         $rendererClass3 = $this->getUniqueId('myRenderer3');
         $rendererObject3 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMockClassName($rendererClass3)
             ->getMock();
-        $rendererObject3->expects(self::any())->method('getPriority')->will(self::returnValue(2));
+        $rendererObject3->expects(self::any())->method('getPriority')->willReturn(2);
 
         $createdRendererInstances = [
             [$rendererClass1, $rendererObject1],
@@ -135,13 +135,13 @@ class RendererRegistryTest extends UnitTestCase
         $rendererObject1 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMockClassName($rendererClass1)
             ->getMock();
-        $rendererObject1->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $rendererObject1->expects(self::any())->method('getPriority')->willReturn(1);
 
         $rendererClass2 = $this->getUniqueId('myRenderer2');
         $rendererObject2 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMockClassName($rendererClass2)
             ->getMock();
-        $rendererObject2->expects(self::any())->method('getPriority')->will(self::returnValue(1));
+        $rendererObject2->expects(self::any())->method('getPriority')->willReturn(1);
 
         $createdRendererInstances = [
             [$rendererClass1, $rendererObject1],
@@ -167,16 +167,16 @@ class RendererRegistryTest extends UnitTestCase
             ->setMethods(['getPriority', 'canRender', 'render'])
             ->setMockClassName($rendererClass1)
             ->getMock();
-        $rendererObject1->expects(self::any())->method('getPriority')->will(self::returnValue(1));
-        $rendererObject1->expects(self::once())->method('canRender')->will(self::returnValue(true));
+        $rendererObject1->expects(self::any())->method('getPriority')->willReturn(1);
+        $rendererObject1->expects(self::once())->method('canRender')->willReturn(true);
 
         $rendererClass2 = $this->getUniqueId('myAudioRenderer');
         $rendererObject2 = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface::class)
             ->setMethods(['getPriority', 'canRender', 'render'])
             ->setMockClassName($rendererClass2)
             ->getMock();
-        $rendererObject2->expects(self::any())->method('getPriority')->will(self::returnValue(10));
-        $rendererObject2->expects(self::once())->method('canRender')->will(self::returnValue(false));
+        $rendererObject2->expects(self::any())->method('getPriority')->willReturn(10);
+        $rendererObject2->expects(self::once())->method('canRender')->willReturn(false);
 
         $fileResourceMock = $this->createMock(\TYPO3\CMS\Core\Resource\File::class);
 
@@ -207,7 +207,7 @@ class RendererRegistryTest extends UnitTestCase
         $rendererRegistry->registerRendererClass(VideoTagRenderer::class);
 
         $fileResourceMock = $this->createMock(\TYPO3\CMS\Core\Resource\File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/mp4'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/mp4');
 
         $rendererRegistry->getRendererInstances();
 
index 1b606fd..f42a9f0 100644 (file)
@@ -42,13 +42,13 @@ class VideoTagRendererTest extends UnitTestCase
         $VideoTagRenderer = new VideoTagRenderer();
 
         $fileResourceMock1 = $this->createMock(File::class);
-        $fileResourceMock1->expects(self::any())->method('getMimeType')->will(self::returnValue('video/mp4'));
+        $fileResourceMock1->expects(self::any())->method('getMimeType')->willReturn('video/mp4');
         $fileResourceMock2 = $this->createMock(File::class);
-        $fileResourceMock2->expects(self::any())->method('getMimeType')->will(self::returnValue('video/webm'));
+        $fileResourceMock2->expects(self::any())->method('getMimeType')->willReturn('video/webm');
         $fileResourceMock3 = $this->createMock(File::class);
-        $fileResourceMock3->expects(self::any())->method('getMimeType')->will(self::returnValue('video/ogg'));
+        $fileResourceMock3->expects(self::any())->method('getMimeType')->willReturn('video/ogg');
         $fileResourceMock4 = $this->createMock(File::class);
-        $fileResourceMock4->expects(self::any())->method('getMimeType')->will(self::returnValue('application/ogg'));
+        $fileResourceMock4->expects(self::any())->method('getMimeType')->willReturn('application/ogg');
 
         self::assertTrue($VideoTagRenderer->canRender($fileResourceMock1));
         self::assertTrue($VideoTagRenderer->canRender($fileResourceMock2));
@@ -64,7 +64,7 @@ class VideoTagRendererTest extends UnitTestCase
         $VideoTagRenderer = new VideoTagRenderer();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('audio/mpeg'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('audio/mpeg');
 
         self::assertFalse($VideoTagRenderer->canRender($fileResourceMock));
     }
@@ -148,8 +148,8 @@ class VideoTagRendererTest extends UnitTestCase
         $VideoTagRenderer = new VideoTagRenderer();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/mp4'));
-        $fileResourceMock->expects(self::any())->method('getPublicUrl')->will(self::returnValue($url));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/mp4');
+        $fileResourceMock->expects(self::any())->method('getPublicUrl')->willReturn($url);
 
         self::assertSame(
             $expected,
index 9f256e7..e53c221 100644 (file)
@@ -40,10 +40,10 @@ class VimeoRendererTest extends UnitTestCase
 
         /** @var VimeoHelper|\PHPUnit_Framework_MockObject_MockObject $vimeoHelper */
         $vimeoHelper = $this->getAccessibleMock(VimeoHelper::class, ['getOnlineMediaId'], ['vimeo']);
-        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->will(self::returnValue('7331'));
+        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->willReturn('7331');
 
         $this->subject = $this->getAccessibleMock(VimeoRenderer::class, ['getOnlineMediaHelper'], []);
-        $this->subject->expects(self::any())->method('getOnlineMediaHelper')->will(self::returnValue($vimeoHelper));
+        $this->subject->expects(self::any())->method('getOnlineMediaHelper')->willReturn($vimeoHelper);
     }
 
     /**
@@ -61,11 +61,11 @@ class VimeoRendererTest extends UnitTestCase
     {
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock1 */
         $fileResourceMock1 = $this->createMock(File::class);
-        $fileResourceMock1->expects(self::any())->method('getMimeType')->will(self::returnValue('video/vimeo'));
+        $fileResourceMock1->expects(self::any())->method('getMimeType')->willReturn('video/vimeo');
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock2 */
         $fileResourceMock2 = $this->createMock(File::class);
-        $fileResourceMock2->expects(self::any())->method('getMimeType')->will(self::returnValue('video/unknown'));
-        $fileResourceMock2->expects(self::any())->method('getExtension')->will(self::returnValue('vimeo'));
+        $fileResourceMock2->expects(self::any())->method('getMimeType')->willReturn('video/unknown');
+        $fileResourceMock2->expects(self::any())->method('getExtension')->willReturn('vimeo');
 
         self::assertTrue($this->subject->canRender($fileResourceMock1));
         self::assertTrue($this->subject->canRender($fileResourceMock2));
@@ -78,7 +78,7 @@ class VimeoRendererTest extends UnitTestCase
     {
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/youtube'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/youtube');
 
         self::assertFalse($this->subject->canRender($fileResourceMock));
     }
@@ -135,7 +135,7 @@ class VimeoRendererTest extends UnitTestCase
 
         /** @var FileReference|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileReferenceMock = $this->createMock(FileReference::class);
-        $fileReferenceMock->expects(self::any())->method('getProperty')->will(self::returnValue(1));
+        $fileReferenceMock->expects(self::any())->method('getProperty')->willReturn(1);
         $fileReferenceMock->expects(self::any())->method('getOriginalFile')->willReturn($fileResourceMock);
 
         self::assertSame(
@@ -235,10 +235,10 @@ class VimeoRendererTest extends UnitTestCase
     {
         /** @var VimeoHelper|\PHPUnit_Framework_MockObject_MockObject $vimeoHelper */
         $vimeoHelper = $this->getAccessibleMock(VimeoHelper::class, ['getOnlineMediaId'], ['vimeo']);
-        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->will(self::returnValue('7331/private0123'));
+        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->willReturn('7331/private0123');
 
         $subject = $this->getAccessibleMock(VimeoRenderer::class, ['getOnlineMediaHelper'], []);
-        $subject->expects(self::any())->method('getOnlineMediaHelper')->will(self::returnValue($vimeoHelper));
+        $subject->expects(self::any())->method('getOnlineMediaHelper')->willReturn($vimeoHelper);
 
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileResourceMock = $this->createMock(File::class);
@@ -256,10 +256,10 @@ class VimeoRendererTest extends UnitTestCase
     {
         /** @var VimeoHelper|\PHPUnit_Framework_MockObject_MockObject $vimeoHelper */
         $vimeoHelper = $this->getAccessibleMock(VimeoHelper::class, ['getOnlineMediaId'], ['vimeo']);
-        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->will(self::returnValue('7331<script>danger</script>\'"random"quotes;'));
+        $vimeoHelper->expects(self::any())->method('getOnlineMediaId')->willReturn('7331<script>danger</script>\'"random"quotes;');
 
         $subject = $this->getAccessibleMock(VimeoRenderer::class, ['getOnlineMediaHelper'], []);
-        $subject->expects(self::any())->method('getOnlineMediaHelper')->will(self::returnValue($vimeoHelper));
+        $subject->expects(self::any())->method('getOnlineMediaHelper')->willReturn($vimeoHelper);
 
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileResourceMock = $this->createMock(File::class);
index 2fac9e8..0f4c83c 100644 (file)
@@ -41,10 +41,10 @@ class YouTubeRendererTest extends UnitTestCase
 
         /** @var YouTubeHelper|\PHPUnit_Framework_MockObject_MockObject $youTubeHelper */
         $youTubeHelper = $this->getAccessibleMock(YouTubeHelper::class, ['getOnlineMediaId'], ['youtube']);
-        $youTubeHelper->expects(self::any())->method('getOnlineMediaId')->will(self::returnValue('7331'));
+        $youTubeHelper->expects(self::any())->method('getOnlineMediaId')->willReturn('7331');
 
         $this->subject = $this->getAccessibleMock(YouTubeRenderer::class, ['getOnlineMediaHelper'], []);
-        $this->subject ->expects(self::any())->method('getOnlineMediaHelper')->will(self::returnValue($youTubeHelper));
+        $this->subject ->expects(self::any())->method('getOnlineMediaHelper')->willReturn($youTubeHelper);
     }
 
     /**
@@ -62,11 +62,11 @@ class YouTubeRendererTest extends UnitTestCase
     {
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock1 */
         $fileResourceMock1 = $this->createMock(File::class);
-        $fileResourceMock1->expects(self::any())->method('getMimeType')->will(self::returnValue('video/youtube'));
+        $fileResourceMock1->expects(self::any())->method('getMimeType')->willReturn('video/youtube');
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock2 */
         $fileResourceMock2 = $this->createMock(File::class);
-        $fileResourceMock2->expects(self::any())->method('getMimeType')->will(self::returnValue('video/unknown'));
-        $fileResourceMock2->expects(self::any())->method('getExtension')->will(self::returnValue('youtube'));
+        $fileResourceMock2->expects(self::any())->method('getMimeType')->willReturn('video/unknown');
+        $fileResourceMock2->expects(self::any())->method('getExtension')->willReturn('youtube');
 
         self::assertTrue($this->subject->canRender($fileResourceMock1));
         self::assertTrue($this->subject->canRender($fileResourceMock2));
@@ -79,7 +79,7 @@ class YouTubeRendererTest extends UnitTestCase
     {
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/vimeo'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/vimeo');
 
         self::assertFalse($this->subject->canRender($fileResourceMock));
     }
@@ -122,7 +122,7 @@ class YouTubeRendererTest extends UnitTestCase
 
         /** @var FileReference|\PHPUnit_Framework_MockObject_MockObject $fileReferenceMock */
         $fileReferenceMock = $this->createMock(FileReference::class);
-        $fileReferenceMock->expects(self::any())->method('getProperty')->will(self::returnValue(1));
+        $fileReferenceMock->expects(self::any())->method('getProperty')->willReturn(1);
         $fileReferenceMock->expects(self::any())->method('getOriginalFile')->willReturn($fileResourceMock);
 
         self::assertSame(
@@ -349,10 +349,10 @@ class YouTubeRendererTest extends UnitTestCase
     {
         /** @var YouTubeHelper|\PHPUnit_Framework_MockObject_MockObject $youtubeHelper */
         $youtubeHelper = $this->getAccessibleMock(YouTubeHelper::class, ['getOnlineMediaId'], ['youtube']);
-        $youtubeHelper->expects(self::any())->method('getOnlineMediaId')->will(self::returnValue('7331<script>danger</script>\'"random"quotes;'));
+        $youtubeHelper->expects(self::any())->method('getOnlineMediaId')->willReturn('7331<script>danger</script>\'"random"quotes;');
 
         $subject = $this->getAccessibleMock(YouTubeRenderer::class, ['getOnlineMediaHelper'], []);
-        $subject->expects(self::any())->method('getOnlineMediaHelper')->will(self::returnValue($youtubeHelper));
+        $subject->expects(self::any())->method('getOnlineMediaHelper')->willReturn($youtubeHelper);
 
         /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
         $fileResourceMock = $this->createMock(File::class);
index 795ff77..d7dcab9 100644 (file)
@@ -113,7 +113,7 @@ class ResourceCompressorTest extends BaseTestCase
         $this->subject->expects(self::once())
             ->method('compressCssFile')
             ->with($fileName)
-            ->will(self::returnValue($compressedFileName));
+            ->willReturn($compressedFileName);
 
         $result = $this->subject->compressCssFiles($testFileFixture);
 
@@ -138,7 +138,7 @@ class ResourceCompressorTest extends BaseTestCase
         $this->subject->expects(self::once())
             ->method('compressJsFile')
             ->with($fileName)
-            ->will(self::returnValue($compressedFileName));
+            ->willReturn($compressedFileName);
 
         $result = $this->subject->compressJsFiles($testFileFixture);
 
@@ -163,7 +163,7 @@ class ResourceCompressorTest extends BaseTestCase
         ];
         $this->subject->expects(self::once())
             ->method('createMergedCssFile')
-            ->will(self::returnValue($concatenatedFileName));
+            ->willReturn($concatenatedFileName);
 
         $result = $this->subject->concatenateCssFiles($testFileFixture);
 
@@ -279,7 +279,7 @@ class ResourceCompressorTest extends BaseTestCase
         $this->subject->expects(self::once())
             ->method('createMergedCssFile')
             ->with(self::equalTo([$screen1FileName, $screen3FileName]))
-            ->will(self::returnValue('merged_screen'));
+            ->willReturn('merged_screen');
 
         $result = $this->subject->concatenateCssFiles($testFileFixture);
         self::assertEquals([
@@ -306,7 +306,7 @@ class ResourceCompressorTest extends BaseTestCase
         ];
         $this->subject->expects(self::once())
             ->method('createMergedJsFile')
-            ->will(self::returnValue($concatenatedFileName));
+            ->willReturn($concatenatedFileName);
 
         $result = $this->subject->concatenateJsFiles($testFileFixture);
 
@@ -435,7 +435,7 @@ class ResourceCompressorTest extends BaseTestCase
         $concatenatedFileName = 'merged_foo.js';
         $this->subject->expects(self::once())
             ->method('createMergedJsFile')
-            ->will(self::returnValue($concatenatedFileName));
+            ->willReturn($concatenatedFileName);
 
         $result = $this->subject->concatenateJsFiles($input);
 
index 9fe6e4b..c9d3e2f 100644 (file)
@@ -87,7 +87,7 @@ class ResourceFactoryTest extends UnitTestCase
         $driverFixtureClass = get_class($mockedDriver);
         \TYPO3\CMS\Core\Utility\GeneralUtility::addInstance($driverFixtureClass, $mockedDriver);
         $mockedRegistry = $this->createMock(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class);
-        $mockedRegistry->expects(self::once())->method('getDriverClass')->with(self::equalTo($driverFixtureClass))->will(self::returnValue($driverFixtureClass));
+        $mockedRegistry->expects(self::once())->method('getDriverClass')->with(self::equalTo($driverFixtureClass))->willReturn($driverFixtureClass);
         \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class, $mockedRegistry);
         $obj = $this->subject->getDriverObject($driverFixtureClass, []);
         self::assertInstanceOf(\TYPO3\CMS\Core\Resource\Driver\AbstractDriver::class, $obj);
index 020ddb1..c185543 100644 (file)
@@ -115,11 +115,11 @@ class ResourceStorageTest extends BaseTestCase
             ->setMethods(array_unique($mockedMethods))
             ->setConstructorArgs([$driverObject, $storageRecord])
             ->getMock();
-        $this->subject->expects(self::any())->method('getResourceFactoryInstance')->will(self::returnValue($resourceFactory));
-        $this->subject->expects(self::any())->method('getIndexer')->will(self::returnValue($this->createMock(Indexer::class)));
+        $this->subject->expects(self::any())->method('getResourceFactoryInstance')->willReturn($resourceFactory);
+        $this->subject->expects(self::any())->method('getIndexer')->willReturn($this->createMock(Indexer::class));
         if ($mockPermissionChecks) {
             foreach ($permissionMethods as $method) {
-                $this->subject->expects(self::any())->method($method)->will(self::returnValue(true));
+                $this->subject->expects(self::any())->method($method)->willReturn(true);
             }
         }
     }
@@ -308,8 +308,8 @@ class ResourceStorageTest extends BaseTestCase
             ->setMethods(['isOnline', 'getResourceFactoryInstance'])
             ->setConstructorArgs([$driver, ['configuration' => []]])
             ->getMock();
-        $subject->expects(self::once())->method('isOnline')->will(self::returnValue(false));
-        $subject->expects(self::any())->method('getResourceFactoryInstance')->will(self::returnValue($mockedResourceFactory));
+        $subject->expects(self::once())->method('isOnline')->willReturn(false);
+        $subject->expects(self::any())->method('getResourceFactoryInstance')->willReturn($mockedResourceFactory);
 
         $sourceFileIdentifier = '/sourceFile.ext';
         $sourceFile = $this->getSimpleFileMock($sourceFileIdentifier);
@@ -357,7 +357,7 @@ class ResourceStorageTest extends BaseTestCase
     ): void {
         /** @var $mockedDriver LocalDriver|\PHPUnit_Framework_MockObject_MockObject */
         $mockedDriver = $this->createMock(LocalDriver::class);
-        $mockedDriver->expects(self::any())->method('getPermissions')->will(self::returnValue($permissionsFromDriver));
+        $mockedDriver->expects(self::any())->method('getPermissions')->willReturn($permissionsFromDriver);
         $mockedResourceFactory = $this->createMock(ResourceFactory::class);
         /** @var $mockedFolder Folder|\PHPUnit_Framework_MockObject_MockObject */
         $mockedFolder = $this->createMock(Folder::class);
@@ -367,10 +367,10 @@ class ResourceStorageTest extends BaseTestCase
             ->setMethods(['isWritable', 'isBrowsable', 'checkUserActionPermission', 'getResourceFactoryInstance'])
             ->setConstructorArgs([$mockedDriver, []])
             ->getMock();
-        $subject->expects(self::any())->method('isWritable')->will(self::returnValue(true));
-        $subject->expects(self::any())->method('isBrowsable')->will(self::returnValue(true));
-        $subject->expects(self::any())->method('checkUserActionPermission')->will(self::returnValue(true));
-        $subject->expects(self::any())->method('getResourceFactoryInstance')->will(self::returnValue($mockedResourceFactory));
+        $subject->expects(self::any())->method('isWritable')->willReturn(true);
+        $subject->expects(self::any())->method('isBrowsable')->willReturn(true);
+        $subject->expects(self::any())->method('checkUserActionPermission')->willReturn(true);
+        $subject->expects(self::any())->method('getResourceFactoryInstance')->willReturn($mockedResourceFactory);
         $subject->setDriver($mockedDriver);
 
         self::assertSame($expectedResult, $subject->checkFolderActionPermission($action, $mockedFolder));
@@ -554,7 +554,7 @@ class ResourceStorageTest extends BaseTestCase
             ->setMethods(['getFileIndexRepository', 'checkFileActionPermission'])
             ->setConstructorArgs([$driverObject, []])
             ->getMock();
-        $this->subject->expects(self::any())->method('checkFileActionPermission')->will(self::returnValue(true));
+        $this->subject->expects(self::any())->method('checkFileActionPermission')->willReturn(true);
         $fileInfo = [
             'storage' => 'A',
             'identifier' => 'B',
@@ -578,19 +578,19 @@ class ResourceStorageTest extends BaseTestCase
         $mockedDriver = $this->getMockBuilder(LocalDriver::class)
             ->setConstructorArgs([['basePath' => $this->getMountRootUrl()]])
             ->getMock();
-        $mockedDriver->expects(self::once())->method('getFileInfoByIdentifier')->will(self::returnValue($fileInfo));
-        $mockedDriver->expects(self::once())->method('hash')->will(self::returnValue($hash));
+        $mockedDriver->expects(self::once())->method('getFileInfoByIdentifier')->willReturn($fileInfo);
+        $mockedDriver->expects(self::once())->method('hash')->willReturn($hash);
         $this->subject->setDriver($mockedDriver);
         $indexFileRepositoryMock = $this->createMock(FileIndexRepository::class);
-        $this->subject->expects(self::any())->method('getFileIndexRepository')->will(self::returnValue($indexFileRepositoryMock));
+        $this->subject->expects(self::any())->method('getFileIndexRepository')->willReturn($indexFileRepositoryMock);
         /** @var $mockedFile File|\PHPUnit_Framework_MockObject_MockObject */
         $mockedFile = $this->createMock(File::class);
-        $mockedFile->expects(self::any())->method('getIdentifier')->will(self::returnValue($fileInfo['identifier']));
+        $mockedFile->expects(self::any())->method('getIdentifier')->willReturn($fileInfo['identifier']);
         // called by indexer because the properties are updated
-        $this->subject->expects(self::any())->method('getFileInfoByIdentifier')->will(self::returnValue($newProperties));
-        $mockedFile->expects(self::any())->method('getStorage')->will(self::returnValue($this->subject));
-        $mockedFile->expects(self::any())->method('getProperties')->will(self::returnValue(array_keys($fileInfo)));
-        $mockedFile->expects(self::any())->method('getUpdatedProperties')->will(self::returnValue(array_keys($newProperties)));
+        $this->subject->expects(self::any())->method('getFileInfoByIdentifier')->willReturn($newProperties);
+        $mockedFile->expects(self::any())->method('getStorage')->willReturn($this->subject);
+        $mockedFile->expects(self::any())->method('getProperties')->willReturn(array_keys($fileInfo));
+        $mockedFile->expects(self::any())->method('getUpdatedProperties')->willReturn(array_keys($newProperties));
         // do not update directly; that's up to the indexer
         $indexFileRepositoryMock->expects(self::never())->method('update');
         $this->subject->setFileContents($mockedFile, $this->getUniqueId());
@@ -626,20 +626,20 @@ class ResourceStorageTest extends BaseTestCase
         $configuration = $this->convertConfigurationArrayToFlexformXml([]);
         $sourceStorage = new ResourceStorage($sourceDriver, ['configuration' => $configuration]);
         $sourceFile = $this->getSimpleFileMock($sourceFileIdentifier);
-        $sourceFile->expects(self::once())->method('getForLocalProcessing')->will(self::returnValue($localFilePath));
-        $sourceFile->expects(self::any())->method('getStorage')->will(self::returnValue($sourceStorage));
-        $sourceFile->expects(self::once())->method('getUpdatedProperties')->will(self::returnValue(array_keys($fileInfoDummy)));
-        $sourceFile->expects(self::once())->method('getProperties')->will(self::returnValue($fileInfoDummy));
+        $sourceFile->expects(self::once())->method('getForLocalProcessing')->willReturn($localFilePath);
+        $sourceFile->expects(self::any())->method('getStorage')->willReturn($sourceStorage);
+        $sourceFile->expects(self::once())->method('getUpdatedProperties')->willReturn(array_keys($fileInfoDummy));
+        $sourceFile->expects(self::once())->method('getProperties')->willReturn($fileInfoDummy);
         /** @var $mockedDriver \TYPO3\CMS\Core\Resource\Driver\LocalDriver|\PHPUnit_Framework_MockObject_MockObject */
         $mockedDriver = $this->getMockBuilder(LocalDriver::class)
             ->setConstructorArgs([['basePath' => $this->getMountRootUrl()]])
             ->getMock();
-        $mockedDriver->expects(self::once())->method('getFileInfoByIdentifier')->will(self::returnValue($fileInfoDummy));
+        $mockedDriver->expects(self::once())->method('getFileInfoByIdentifier')->willReturn($fileInfoDummy);
         $mockedDriver->expects(self::once())->method('addFile')->with(
             $localFilePath,
             '/targetFolder/',
             self::equalTo('file.ext')
-        )->will(self::returnValue('/targetFolder/file.ext'));
+        )->willReturn('/targetFolder/file.ext');
         /** @var $subject ResourceStorage */
         $subject = $this->getMockBuilder(ResourceStorage::class)
             ->setMethods(['assureFileMovePermissions'])
@@ -679,8 +679,8 @@ class ResourceStorageTest extends BaseTestCase
         self::markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
         $mockedParentFolder = $this->getSimpleFolderMock('/someFolder/');
         $mockedDriver = $this->createDriverMock([]);
-        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->will(self::returnValue(true));
-        $mockedDriver->expects(self::once())->method('createFolder')->with(self::equalTo('newFolder'))->will(self::returnValue($mockedParentFolder));
+        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->willReturn(true);
+        $mockedDriver->expects(self::once())->method('createFolder')->with(self::equalTo('newFolder'))->willReturn($mockedParentFolder);
         $this->prepareSubject([], true);
         $this->subject->setDriver($mockedDriver);
         $this->subject->createFolder('newFolder', $mockedParentFolder);
@@ -698,10 +698,10 @@ class ResourceStorageTest extends BaseTestCase
         $folderMock = $this->createMock(Folder::class);
         /** @var $mockedDriver \TYPO3\CMS\Core\Resource\Driver\AbstractDriver|\PHPUnit_Framework_MockObject_MockObject */
         $mockedDriver = $this->getMockForAbstractClass(AbstractDriver::class);
-        $mockedDriver->expects(self::once())->method('isFolderEmpty')->will(self::returnValue(false));
+        $mockedDriver->expects(self::once())->method('isFolderEmpty')->willReturn(false);
         /** @var $subject ResourceStorage|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
         $subject = $this->getAccessibleMock(ResourceStorage::class, ['checkFolderActionPermission'], [], '', false);
-        $subject->expects(self::any())->method('checkFolderActionPermission')->will(self::returnValue(true));
+        $subject->expects(self::any())->method('checkFolderActionPermission')->willReturn(true);
         $subject->_set('driver', $mockedDriver);
         $subject->deleteFolder($folderMock, false);
     }
@@ -719,8 +719,8 @@ class ResourceStorageTest extends BaseTestCase
         $mockedDriver->expects(self::once())->method('createFolder')->with(
             self::equalTo('newFolder'),
             self::equalTo('/someFolder/')
-        )->will(self::returnValue(true));
-        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->will(self::returnValue(true));
+        )->willReturn(true);
+        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->willReturn(true);
         $this->subject->createFolder('newFolder', $mockedParentFolder);
     }
 
@@ -750,7 +750,7 @@ class ResourceStorageTest extends BaseTestCase
         self::markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
         $this->prepareSubject([], true);
         $mockedDriver = $this->createDriverMock([], $this->subject);
-        $mockedDriver->expects(self::once())->method('getRootLevelFolder')->with()->will(self::returnValue('/'));
+        $mockedDriver->expects(self::once())->method('getRootLevelFolder')->with()->willReturn('/');
         $mockedDriver->expects(self::once())->method('createFolder')->with(self::equalTo('someFolder'));
         $this->subject->createFolder('someFolder');
     }
@@ -784,7 +784,7 @@ class ResourceStorageTest extends BaseTestCase
         $mockedParentFolder = $this->getSimpleFolderMock('/someFolder/');
         $this->prepareSubject([], true);
         $mockedDriver = $this->createDriverMock([], $this->subject);
-        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->will(self::returnValue(false));
+        $mockedDriver->expects(self::once())->method('folderExists')->with(self::equalTo('/someFolder/'))->willReturn(false);
         $this->subject->createFolder('newFolder', $mockedParentFolder);
     }
 
@@ -794,7 +794,7 @@ class ResourceStorageTest extends BaseTestCase
     public function renameFileRenamesFileAsRequested(): void
     {
         $mockedDriver = $this->createDriverMock([], $this->subject);
-        $mockedDriver->expects(self::once())->method('renameFile')->will(self::returnValue('bar'));
+        $mockedDriver->expects(self::once())->method('renameFile')->willReturn('bar');
         $this->prepareSubject([], true, $mockedDriver, null, [], ['emitPreFileRenameSignal', 'emitPostFileRenameSignal']);
         /** @var File $file */
         $file = new File(['identifier' => 'foo', 'name' => 'foo'], $this->subject);
@@ -828,10 +828,10 @@ class ResourceStorageTest extends BaseTestCase
             [],
             ['emitPreFileRenameSignal', 'emitPostFileRenameSignal', 'getUniqueName']
         );
-        $resourceFactory->expects(self::once())->method('createFolderObject')->will(self::returnValue(new Folder($this->subject, '', '')));
+        $resourceFactory->expects(self::once())->method('createFolderObject')->willReturn(new Folder($this->subject, '', ''));
         /** @var File $file */
         $file = new File(['identifier' => 'foo', 'name' => 'foo'], $this->subject);
-        $this->subject->expects(self::any())->method('getUniqueName')->will(self::returnValue('bar_01'));
+        $this->subject->expects(self::any())->method('getUniqueName')->willReturn('bar_01');
         $result = $this->subject->renameFile($file, 'bar');
         // fake what the indexer does in updateIndexEntry
         $result->updateProperties(['name' => $result->getIdentifier()]);
@@ -865,7 +865,7 @@ class ResourceStorageTest extends BaseTestCase
             'foo',
             1489593098
         )));
-        $mockedDriver->expects(self::any())->method('sanitizeFileName')->will(self::returnValue('bar'));
+        $mockedDriver->expects(self::any())->method('sanitizeFileName')->willReturn('bar');
         $resourceFactory = $this->prophesize(ResourceFactory::class);
         $this->prepareSubject([], true, $mockedDriver, $resourceFactory->reveal(), [], [
             'emitPreFileRenameSignal',
@@ -873,10 +873,10 @@ class ResourceStorageTest extends BaseTestCase
             'replaceFile',
             'getPublicUrl',
         ]);
-        $this->subject->expects(self::once())->method('getPublicUrl')->will(self::returnValue('somePath'));
+        $this->subject->expects(self::once())->method('getPublicUrl')->willReturn('somePath');
         $file = $this->prophesize(FileInterface::class);
         $resourceFactory->getFileObjectFromCombinedIdentifier(Argument::any())->willReturn($file->reveal());
-        $this->subject->expects(self::once())->method('replaceFile')->will(self::returnValue($file->reveal()));
+        $this->subject->expects(self::once())->method('replaceFile')->willReturn($file->reveal());
         /** @var File $file */
         $file = new File(['identifier' => 'foo', 'name' => 'foo', 'missing' => false], $this->subject);
         $this->subject->renameFile($file, 'bar', DuplicationBehavior::REPLACE);
index 5220392..e21eaf5 100644 (file)
@@ -149,12 +149,12 @@ class ExtractorServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
             ->setMethods(['createExtractorInstance'])
             ->getMock();
 
-        $extractorRegistryMock->expects(self::any())->method('createExtractorInstance')->will(self::returnValueMap(
+        $extractorRegistryMock->expects(self::any())->method('createExtractorInstance')->willReturnMap(
             [
                 [$extractorClass1, $extractorObject1],
                 [$extractorClass2, $extractorObject2]
             ]
-        ));
+        );
         $extractorRegistryMock->registerExtractionService($extractorClass1);
         $extractorRegistryMock->registerExtractionService($extractorClass2);
 
index 1b4ddef..5dd400c 100644 (file)
@@ -31,7 +31,7 @@ class PlainTextExtractorTest extends UnitTestCase
         $plainTextExtractor = new PlainTextExtractor();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('text/plain'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('text/plain');
 
         self::assertTrue($plainTextExtractor->canExtractText($fileResourceMock));
     }
@@ -44,7 +44,7 @@ class PlainTextExtractorTest extends UnitTestCase
         $plainTextExtractor = new PlainTextExtractor();
 
         $fileResourceMock = $this->createMock(File::class);
-        $fileResourceMock->expects(self::any())->method('getMimeType')->will(self::returnValue('video/mp4'));
+        $fileResourceMock->expects(self::any())->method('getMimeType')->willReturn('video/mp4');
 
         self::assertFalse($plainTextExtractor->canExtractText($fileResourceMock));
     }
index 0ce968b..363df21 100644 (file)
@@ -38,7 +38,7 @@ class TextExtractorRegistryTest extends UnitTestCase
         if (!empty($createsTextExtractorInstances)) {
             $textExtractorRegistry->expects(self::any())
                 ->method('createTextExtractorInstance')
-                ->will(self::returnValueMap($createsTextExtractorInstances));
+                ->willReturnMap($createsTextExtractorInstances);
         }
 
         return $textExtractorRegistry;
index e112118..3af1696 100644 (file)
@@ -104,7 +104,7 @@ class FlexFormServiceTest extends UnitTestCase
         // The subject calls xml2array statically, which calls a runtime cache, this need to be mocked.
         $cacheManagerMock = $this->createMock(\TYPO3\CMS\Core\Cache\CacheManager::class);
         $cacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class);
-        $cacheManagerMock->expects(self::any())->method('getCache')->will(self::returnValue($cacheMock));
+        $cacheManagerMock->expects(self::any())->method('getCache')->willReturn($cacheMock);
         GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $cacheManagerMock);
 
         $flexFormService = $this->getMockBuilder(\TYPO3\CMS\Core\Service\FlexFormService::class)
index 240968c..fe152bb 100644 (file)
@@ -118,7 +118,7 @@ class DatabaseTreeDataProviderTest extends UnitTestCase
     protected function initializeSubjectMock(array $mockMethods)
     {
         $this->subject = $this->getAccessibleMock(DatabaseTreeDataProvider::class, $mockMethods, [], '', false);
-        $this->subject->expects(self::any())->method('getRootUid')->will(self::returnValue(0));
+        $this->subject->expects(self::any())->method('getRootUid')->willReturn(0);
         $this->subject->_set('treeData', $this->treeData);
     }
 
@@ -158,7 +158,7 @@ class DatabaseTreeDataProviderTest extends UnitTestCase
 
         $this->initializeSubjectMock(['getRelatedRecords', 'getRootUid']);
         $this->subject->_set('levelMaximum', 1);
-        $this->subject->expects(self::once())->method('getRelatedRecords')->will(self::returnValue([1]));
+        $this->subject->expects(self::once())->method('getRelatedRecords')->willReturn([1]);
         $storage = $this->subject->_call('getChildrenOf', $this->treeData, 1);
 
         self::assertEquals($expectedStorage, $storage);
@@ -187,8 +187,8 @@ class DatabaseTreeDataProviderTest extends UnitTestCase
 
         $this->initializeSubjectMock(['getRelatedRecords', 'getRootUid']);
         $this->subject->_set('levelMaximum', 2);
-        $this->subject->expects(self::at(0))->method('getRelatedRecords')->will(self::returnValue([1]));
-        $this->subject->expects(self::at(1))->method('getRelatedRecords')->will(self::returnValue([2]));
+        $this->subject->expects(self::at(0))->method('getRelatedRecords')->willReturn([1]);
+        $this->subject->expects(self::at(1))->method('getRelatedRecords')->willReturn([2]);
         $storage = $this->subject->_call('getChildrenOf', $this->treeData, 1);
 
         self::assertEquals($expectedStorage, $storage);
index e8a2130..ff8f3c4 100644 (file)
@@ -114,15 +114,15 @@ class TemplateServiceTest extends UnitTestCase
             ->setMethods(['getPackagePath', 'getPackageKey'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockPackage->expects(self::any())->method('getPackagePath')->will(self::returnValue(__DIR__ . '/Fixtures/'));
-        $mockPackage->expects(self::any())->method('getPackageKey')->will(self::returnValue('core'));
+        $mockPackage->expects(self::any())->method('getPackagePath')->willReturn(__DIR__ . '/Fixtures/');
+        $mockPackage->expects(self::any())->method('getPackageKey')->willReturn('core');
 
         $mockPackageManager = $this->getMockBuilder(PackageManager::class)
             ->setMethods(['isPackageActive', 'getPackage'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockPackageManager->expects(self::any())->method('isPackageActive')->will(self::returnValue(true));
-        $mockPackageManager->expects(self::any())->method('getPackage')->will(self::returnValue($mockPackage));
+        $mockPackageManager->expects(self::any())->method('isPackageActive')->willReturn(true);
+        $mockPackageManager->expects(self::any())->method('getPackage')->willReturn($mockPackage);
         ExtensionManagementUtility::setPackageManager($mockPackageManager);
         $this->packageManagerProphecy->getActivePackages()->willReturn(['core' => $mockPackage]);
 
index ee24763..1351027 100644 (file)
@@ -82,23 +82,23 @@ class ExtensionManagementUtilityTest extends UnitTestCase
             ->getMock();
         $package->expects(self::any())
                 ->method('getPackagePath')
-                ->will(self::returnValue($packagePath));
+                ->willReturn($packagePath);
         $package->expects(self::any())
                 ->method('getPackageKey')
-                ->will(self::returnValue($packageKey));
+                ->willReturn($packageKey);
         $packageManager->expects(self::any())
                 ->method('isPackageActive')
-                ->will(self::returnValueMap([
+                ->willReturnMap([
                     [null, false],
                     [$packageKey, true]
-                ]));
+                ]);
         $packageManager->expects(self::any())
                 ->method('getPackage')
                 ->with(self::equalTo($packageKey))
-                ->will(self::returnValue($package));
+                ->willReturn($package);
         $packageManager->expects(self::any())
                 ->method('getActivePackages')
-                ->will(self::returnValue([$packageKey => $package]));
+                ->willReturn([$packageKey => $package]);
         return $packageManager;
     }
 
@@ -133,7 +133,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $packageManager->expects(self::once())
                 ->method('isPackageActive')
                 ->with(self::equalTo($packageName))
-                ->will(self::returnValue(false));
+                ->willReturn(false);
         ExtensionManagementUtility::setPackageManager($packageManager);
         ExtensionManagementUtility::extPath($packageName);
     }
@@ -154,15 +154,15 @@ class ExtensionManagementUtilityTest extends UnitTestCase
             ->getMock();
         $package->expects(self::once())
                 ->method('getPackagePath')
-                ->will(self::returnValue(Environment::getPublicPath() . '/foo/'));
+                ->willReturn(Environment::getPublicPath() . '/foo/');
         $packageManager->expects(self::once())
                 ->method('isPackageActive')
                 ->with(self::equalTo('foo'))
-                ->will(self::returnValue(true));
+                ->willReturn(true);
         $packageManager->expects(self::once())
                 ->method('getPackage')
                 ->with('foo')
-                ->will(self::returnValue($package));
+                ->willReturn($package);
         ExtensionManagementUtility::setPackageManager($packageManager);
         self::assertSame(Environment::getPublicPath() . '/foo/bar.txt', ExtensionManagementUtility::extPath('foo', 'bar.txt'));
     }
@@ -1220,9 +1220,9 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-        $mockCache->expects(self::any())->method('has')->will(self::returnValue(true));
+        $mockCache->expects(self::any())->method('has')->willReturn(true);
         $mockCache->expects(self::once())->method('require');
         ExtensionManagementUtility::loadExtLocalconf(true);
     }
@@ -1450,13 +1450,13 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-        $mockCache->expects(self::once())->method('require')->will(self::returnValue(false));
+        $mockCache->expects(self::once())->method('require')->willReturn(false);
         $mockCache->expects(self::once())->method('set')->with(self::anything(), self::stringContains($uniqueStringInTableConfiguration), self::anything());
 
         $mockSignalSlotDispatcher = $this->createMock(SignalSlotDispatcher::class);
-        $mockSignalSlotDispatcher->expects(self::once())->method('dispatch')->with(self::anything(), self::anything(), self::isType('array'))->will(self::returnArgument(2));
+        $mockSignalSlotDispatcher->expects(self::once())->method('dispatch')->with(self::anything(), self::anything(), self::isType('array'))->willReturnArgument(2);
         ExtensionManagementUtilityAccessibleProxy::setSignalSlotDispatcher($mockSignalSlotDispatcher);
 
         ExtensionManagementUtility::loadBaseTca(true);
@@ -1476,9 +1476,9 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-        $mockCache->expects(self::once())->method('require')->will(self::returnValue(false));
+        $mockCache->expects(self::once())->method('require')->willReturn(false);
         $mockCache->expects(self::once())->method('set')->with(self::anything(), self::anything(), self::equalTo([]));
         ExtensionManagementUtilityAccessibleProxy::loadBaseTca();
     }
@@ -1532,9 +1532,9 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
-        $mockCache->expects(self::any())->method('has')->will(self::returnValue(true));
+        $mockCache->expects(self::any())->method('has')->willReturn(true);
         $mockCache->expects(self::once())->method('require');
         // Reset the internal cache access tracking variable of extMgm
         // This method is only in the ProxyClass!
@@ -1566,7 +1566,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
         $mockCache->expects(self::once())->method('set')->with(self::anything(), self::stringContains($uniqueStringInTables), self::anything());
         ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
@@ -1589,7 +1589,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
         $mockCache->expects(self::once())
             ->method('set')
@@ -1611,7 +1611,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $mockCacheManager = $this->getMockBuilder(CacheManager::class)
             ->setMethods(['getCache'])
             ->getMock();
-        $mockCacheManager->expects(self::any())->method('getCache')->will(self::returnValue($mockCache));
+        $mockCacheManager->expects(self::any())->method('getCache')->willReturn($mockCache);
         ExtensionManagementUtilityAccessibleProxy::setCacheManager($mockCacheManager);
         $mockCache->expects(self::once())->method('set')->with(self::anything(), self::anything(), self::equalTo([]));
         $packageManager = $this->createMockPackageManagerWithMockPackage($this->getUniqueId());
@@ -1687,13 +1687,13 @@ class ExtensionManagementUtilityTest extends UnitTestCase
             ->setMethods(['getVersion'])
             ->setConstructorArgs([$extensionKey])
             ->getMock();
-        $packageMetaData->expects(self::any())->method('getVersion')->will(self::returnValue('1.2.3'));
+        $packageMetaData->expects(self::any())->method('getVersion')->willReturn('1.2.3');
         $packageManager = $this->createMockPackageManagerWithMockPackage($extensionKey, ['getPackagePath', 'getPackageKey', 'getPackageMetaData']);
         /** @var \PHPUnit_Framework_MockObject_MockObject $package */
         $package = $packageManager->getPackage($extensionKey);
         $package->expects(self::any())
                 ->method('getPackageMetaData')
-                ->will(self::returnValue($packageMetaData));
+                ->willReturn($packageMetaData);
         ExtensionManagementUtility::setPackageManager($packageManager);
         self::assertEquals('1.2.3', ExtensionManagementUtility::getExtensionVersion($extensionKey));
     }
@@ -1735,7 +1735,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
         $packageManager->expects(self::once())
             ->method('isPackageActive')
             ->with(self::equalTo($packageName))
-            ->will(self::returnValue(false));
+            ->willReturn(false);
         ExtensionManagementUtility::setPackageManager($packageManager);
         ExtensionManagementUtility::unloadExtension($packageName);
     }
@@ -1753,7 +1753,7 @@ class ExtensionManagementUtilityTest extends UnitTestCase
             ->getMock();
         $packageManager->expects(self::any())
             ->method('isPackageActive')
-            ->will(self::returnValue(true));
+            ->willReturn(true);
         $packageManager->expects(self::once())
             ->method('deactivatePackage')
             ->with($packageName);
index c678670..412fde2 100644 (file)
@@ -50,7 +50,7 @@ class ExtendedFileUtilityTest extends UnitTestCase
             ->setMethods(['getUid'])
             ->disableOriginalConstructor()
             ->getMock();
-        $file->expects(self::once())->method('getUid')->will(self::returnValue($fileUid));
+        $file->expects(self::once())->method('getUid')->willReturn($fileUid);
 
         $folder = $this->getMockBuilder(Folder::class)
             ->setMethods(['getFiles'])
@@ -58,8 +58,8 @@ class ExtendedFileUtilityTest extends UnitTestCase
             ->getMock();
         $folder->expects(self::once())
             ->method('getFiles')->with(0, 0, Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, true)
-            ->will(
-                self::returnValue([$file])
+            ->willReturn(
+                [$file]
             );
 
         /** @var \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $subject */
@@ -88,10 +88,10 @@ class ExtendedFileUtilityTest extends UnitTestCase
 
         $GLOBALS['LANG']->expects(self::at(0))->method('sL')
             ->with('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:message.description.folderNotDeletedHasFilesWithReferences')
-            ->will(self::returnValue('folderNotDeletedHasFilesWithReferences'));
+            ->willReturn('folderNotDeletedHasFilesWithReferences');
         $GLOBALS['LANG']->expects(self::at(1))->method('sL')
             ->with('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:message.header.folderNotDeletedHasFilesWithReferences')
-            ->will(self::returnValue('folderNotDeletedHasFilesWithReferences'));
+            ->willReturn('folderNotDeletedHasFilesWithReferences');
 
         $result = $subject->folderHasFilesInUse($folder);
         self::assertTrue($result);
@@ -106,8 +106,8 @@ class ExtendedFileUtilityTest extends UnitTestCase
             ->setMethods(['getFiles'])
             ->disableOriginalConstructor()
             ->getMock();
-        $folder->expects(self::once())->method('getFiles')->with(0, 0, Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, true)->will(
-            self::returnValue([])
+        $folder->expects(self::once())->method('getFiles')->with(0, 0, Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, true)->willReturn(
+            []
         );
 
         /** @var \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $subject */
index 4e5de24..d5d3dc5 100644 (file)
@@ -3907,15 +3907,15 @@ class GeneralUtilityTest extends UnitTestCase
             ->getMock();
         $package->expects(self::any())
             ->method('getPackagePath')
-            ->will(self::returnValue(Environment::getPublicPath() . '/typo3/sysext/foo/'));
+            ->willReturn(Environment::getPublicPath() . '/typo3/sysext/foo/');
         $packageManager->expects(self::any())
             ->method('isPackageActive')
             ->with(self::equalTo('foo'))
-            ->will(self::returnValue(true));
+            ->willReturn(true);
         $packageManager->expects(self::any())
             ->method('getPackage')
             ->with('foo')
-            ->will(self::returnValue($package));
+            ->willReturn($package);
         ExtensionManagementUtility::setPackageManager($packageManager);
 
         $result = GeneralUtility::getFileAbsFileName($path);
index d74033a..0a7838e 100644 (file)
@@ -179,7 +179,7 @@ class AbstractConfigurationManagerTest extends UnitTestCase
             'settings' => ['foo' => 'bar'],
             'view' => ['subkey' => ['subsubkey' => 'subsubvalue']]
         ];
-        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($expectedResult));
+        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($expectedResult);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         self::assertEquals($expectedResult, $this->abstractConfigurationManager->_get('configuration'));
     }
@@ -221,12 +221,12 @@ class AbstractConfigurationManagerTest extends UnitTestCase
     {
         $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
         $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
-        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($this->testTypoScriptSetup));
-        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->will(self::returnValue($this->testTypoScriptSetupConverted['config']['tx_extbase']));
+        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($this->testTypoScriptSetup);
+        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->willReturn($this->testTypoScriptSetupConverted['config']['tx_extbase']);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $expectedResult = [
             'settings' => [
                 'setting1' => 'overriddenValue1',
@@ -255,12 +255,12 @@ class AbstractConfigurationManagerTest extends UnitTestCase
      */
     public function getConfigurationRecursivelyMergesPluginConfigurationOfSpecifiedPluginWithFrameworkConfiguration(
     ): void {
-        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($this->testTypoScriptSetup));
+        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($this->testTypoScriptSetup);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'SomeExtensionName',
             'SomePluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
-        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->will(self::returnValue($this->testTypoScriptSetupConverted['config']['tx_extbase']));
+        )->willReturn($this->testPluginConfiguration);
+        $this->mockTypoScriptService->expects(self::atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->willReturn($this->testTypoScriptSetupConverted['config']['tx_extbase']);
         $expectedResult = [
             'settings' => [
                 'setting1' => 'overriddenValue1',
@@ -298,15 +298,15 @@ class AbstractConfigurationManagerTest extends UnitTestCase
      */
     public function getConfigurationOverridesConfigurationWithContextSpecificFrameworkConfigurationIfNoPluginWasSpecified(
     ): void {
-        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($this->testTypoScriptSetup));
-        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with()->will(self::returnValue($this->testPluginConfiguration));
+        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($this->testTypoScriptSetup);
+        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with()->willReturn($this->testPluginConfiguration);
         $contextSpecifixFrameworkConfiguration = [
             'context' => [
                 'specific' => 'framwork',
                 'conf' => 'iguration'
             ]
         ];
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnValue($contextSpecifixFrameworkConfiguration));
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturn($contextSpecifixFrameworkConfiguration);
         $actualResult = $this->abstractConfigurationManager->getConfiguration();
         self::assertEquals($contextSpecifixFrameworkConfiguration, $actualResult);
     }
@@ -318,18 +318,18 @@ class AbstractConfigurationManagerTest extends UnitTestCase
     ): void {
         $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
         $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
-        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($this->testTypoScriptSetup));
+        $this->abstractConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($this->testTypoScriptSetup);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $contextSpecifixFrameworkConfiguration = [
             'context' => [
                 'specific' => 'framwork',
                 'conf' => 'iguration'
             ]
         ];
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnValue($contextSpecifixFrameworkConfiguration));
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturn($contextSpecifixFrameworkConfiguration);
         $actualResult = $this->abstractConfigurationManager->getConfiguration(
             'CurrentExtensionName',
             'CurrentPluginName'
@@ -344,7 +344,7 @@ class AbstractConfigurationManagerTest extends UnitTestCase
     {
         $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
         $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
-        $this->abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->will(self::returnValue(['foo' => 'bar']));
+        $this->abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->willReturn(['foo' => 'bar']);
         $this->abstractConfigurationManager->getConfiguration();
         $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
         $expectedResult = [
@@ -366,7 +366,7 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'recursive' => 99
             ]
         ];
-        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->will(self::returnValue($pluginConfiguration));
+        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->willReturn($pluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getRecursiveStoragePids')->with([-1]);
         $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
     }
@@ -382,7 +382,7 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'recursive' => 99
             ]
         ];
-        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->will(self::returnValue($pluginConfiguration));
+        $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->willReturn($pluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getRecursiveStoragePids')->with([-1, -25]);
         $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
     }
@@ -412,7 +412,7 @@ class AbstractConfigurationManagerTest extends UnitTestCase
         );
         $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
         $abstractConfigurationManager->setConfiguration(['switchableControllerActions' => ['overriddenSwitchableControllerActions']]);
-        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->will(self::returnValue([]));
+        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->willReturn([]);
         $abstractConfigurationManager->expects(self::never())->method('overrideControllerConfigurationWithSwitchableControllerActions');
         $abstractConfigurationManager->getConfiguration('SomeExtensionName', 'SomePluginName');
     }
@@ -442,10 +442,10 @@ class AbstractConfigurationManagerTest extends UnitTestCase
             '',
             false
         );
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
         $abstractConfigurationManager->setConfiguration($configuration);
-        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->will(self::returnValue([]));
+        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->willReturn([]);
         $abstractConfigurationManager->expects(self::once())->method('overrideControllerConfigurationWithSwitchableControllerActions');
         $abstractConfigurationManager->getConfiguration('CurrentExtensionName', 'CurrentPluginName');
     }
@@ -471,10 +471,10 @@ class AbstractConfigurationManagerTest extends UnitTestCase
             '',
             false
         );
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
         $abstractConfigurationManager->setConfiguration($configuration);
-        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->will(self::returnValue([]));
+        $abstractConfigurationManager->expects(self::any())->method('getPluginConfiguration')->willReturn([]);
         $abstractConfigurationManager->expects(self::once())->method('overrideControllerConfigurationWithSwitchableControllerActions');
         $abstractConfigurationManager->getConfiguration();
     }
@@ -491,21 +491,21 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'Controller1' => ['action2', 'action1', 'action3']
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getControllerConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testSwitchableControllerActions));
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnCallback(function (
+        )->willReturn($this->testSwitchableControllerActions);
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturnCallback(function (
             $a
         ) {
             return $a;
-        }));
+        });
         $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
         $expectedResult = [
             'MyExtension\\Controller\\Controller1' => [
@@ -531,21 +531,21 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 '\\MyExtension\\Controller\\Controller2' => ['newAction2', 'action4', 'action5']
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getControllerConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testSwitchableControllerActions));
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnCallback(function (
+        )->willReturn($this->testSwitchableControllerActions);
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturnCallback(function (
             $a
         ) {
             return $a;
-        }));
+        });
         $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
         $expectedResult = [
             'MyExtension\\Controller\\Controller1' => [
@@ -576,21 +576,21 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'Controller1' => ['action2', 'action1', 'action3', 'newAction']
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getControllerConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testSwitchableControllerActions));
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnCallback(function (
+        )->willReturn($this->testSwitchableControllerActions);
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturnCallback(function (
             $a
         ) {
             return $a;
-        }));
+        });
         $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
         $expectedResult = [
             'MyExtension\\Controller\\Controller1' => [
@@ -615,21 +615,21 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'NewController' => ['action1', 'action2']
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getControllerConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testSwitchableControllerActions));
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnCallback(function (
+        )->willReturn($this->testSwitchableControllerActions);
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturnCallback(function (
             $a
         ) {
             return $a;
-        }));
+        });
         $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
         $expectedResult = [];
         $actualResult = $mergedConfiguration['controllerConfiguration'];
@@ -649,21 +649,21 @@ class AbstractConfigurationManagerTest extends UnitTestCase
                 'Controller2' => ['newAction2', 'action4', 'action5']
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will(self::returnValue($configuration));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->willReturn($configuration);
         $this->abstractConfigurationManager->setConfiguration($configuration);
         $this->abstractConfigurationManager->expects(self::once())->method('getPluginConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testPluginConfiguration));
+        )->willReturn($this->testPluginConfiguration);
         $this->abstractConfigurationManager->expects(self::once())->method('getControllerConfiguration')->with(
             'CurrentExtensionName',
             'CurrentPluginName'
-        )->will(self::returnValue($this->testSwitchableControllerActions));
-        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->will(self::returnCallback(function (
+        )->willReturn($this->testSwitchableControllerActions);
+        $this->abstractConfigurationManager->expects(self::once())->method('getContextSpecificFrameworkConfiguration')->willReturnCallback(function (
             $a
         ) {
             return $a;
-        }));
+        });
         $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
         $expectedResult = [
             'MyExtension\\Controller\\Controller1' => [
index a8ae6da..aae6329 100644 (file)
@@ -78,7 +78,7 @@ class BackendConfigurationManagerTest extends UnitTestCase
      */
     public function getPluginConfigurationReturnsEmptyArrayIfNoPluginConfigurationWasFound()
     {
-        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue(['foo' => 'bar']));
+        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn(['foo' => 'bar']);
         $expectedResult = [];
         $actualResult = $this->backendConfigurationManager->_call('getPluginConfiguration', 'SomeExtensionName', 'SomePluginName');
         self::assertEquals($expectedResult, $actualResult);
@@ -104,8 +104,8 @@ class BackendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname.' => $testSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->will(self::returnValue($testSettingsConverted));
-        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($testSetup));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->willReturn($testSettingsConverted);
+        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($testSetup);
         $expectedResult = [
             'settings' => [
                 'foo' => 'bar'
@@ -135,8 +135,8 @@ class BackendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname_somepluginname.' => $testSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->will(self::returnValue($testSettingsConverted));
-        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($testSetup));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->willReturn($testSettingsConverted);
+        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($testSetup);
         $expectedResult = [
             'settings' => [
                 'foo' => 'bar'
@@ -189,9 +189,9 @@ class BackendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname_somepluginname.' => $testPluginSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::at(0))->method('convertTypoScriptArrayToPlainArray')->with($testExtensionSettings)->will(self::returnValue($testExtensionSettingsConverted));
-        $this->mockTypoScriptService->expects(self::at(1))->method('convertTypoScriptArrayToPlainArray')->with($testPluginSettings)->will(self::returnValue($testPluginSettingsConverted));
-        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->will(self::returnValue($testSetup));
+        $this->mockTypoScriptService->expects(self::at(0))->method('convertTypoScriptArrayToPlainArray')->with($testExtensionSettings)->willReturn($testExtensionSettingsConverted);
+        $this->mockTypoScriptService->expects(self::at(1))->method('convertTypoScriptArrayToPlainArray')->with($testPluginSettings)->willReturn($testPluginSettingsConverted);
+        $this->backendConfigurationManager->expects(self::once())->method('getTypoScriptSetup')->willReturn($testSetup);
         $expectedResult = [
             'settings' => [
                 'foo' => 'bar',
index 584e598..e3a9611 100644 (file)
@@ -111,7 +111,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname.' => $testSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->will(self::returnValue($testSettingsConverted));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->willReturn($testSettingsConverted);
         $GLOBALS['TSFE']->tmpl->setup = $testSetup;
         $expectedResult = [
             'settings' => [
@@ -142,7 +142,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname_somepluginname.' => $testSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->will(self::returnValue($testSettingsConverted));
+        $this->mockTypoScriptService->expects(self::any())->method('convertTypoScriptArrayToPlainArray')->with($testSettings)->willReturn($testSettingsConverted);
         $GLOBALS['TSFE']->tmpl->setup = $testSetup;
         $expectedResult = [
             'settings' => [
@@ -200,8 +200,8 @@ class FrontendConfigurationManagerTest extends UnitTestCase
                 'tx_someextensionname_somepluginname.' => $testPluginSettings
             ]
         ];
-        $this->mockTypoScriptService->expects(self::at(0))->method('convertTypoScriptArrayToPlainArray')->with($testExtensionSettings)->will(self::returnValue($testExtensionSettingsConverted));
-        $this->mockTypoScriptService->expects(self::at(1))->method('convertTypoScriptArrayToPlainArray')->with($testPluginSettings)->will(self::returnValue($testPluginSettingsConverted));
+        $this->mockTypoScriptService->expects(self::at(0))->method('convertTypoScriptArrayToPlainArray')->with($testExtensionSettings)->willReturn($testExtensionSettingsConverted);
+        $this->mockTypoScriptService->expects(self::at(1))->method('convertTypoScriptArrayToPlainArray')->with($testPluginSettings)->willReturn($testPluginSettingsConverted);
         $GLOBALS['TSFE']->tmpl->setup = $testSetup;
         $expectedResult = [
             'settings' => [
@@ -396,9 +396,9 @@ class FrontendConfigurationManagerTest extends UnitTestCase
             '',
             false
         );
-        $frontendConfigurationManager->expects(self::at(0))->method('overrideStoragePidIfStartingPointIsSet')->with($frameworkConfiguration)->will(self::returnValue(['overridden' => 'storagePid']));
-        $frontendConfigurationManager->expects(self::at(1))->method('overrideConfigurationFromPlugin')->with(['overridden' => 'storagePid'])->will(self::returnValue(['overridden' => 'pluginConfiguration']));
-        $frontendConfigurationManager->expects(self::at(2))->method('overrideConfigurationFromFlexForm')->with(['overridden' => 'pluginConfiguration'])->will(self::returnValue(['overridden' => 'flexFormConfiguration']));
+        $frontendConfigurationManager->expects(self::at(0))->method('overrideStoragePidIfStartingPointIsSet')->with($frameworkConfiguration)->willReturn(['overridden' => 'storagePid']);
+        $frontendConfigurationManager->expects(self::at(1))->method('overrideConfigurationFromPlugin')->with(['overridden' => 'storagePid'])->willReturn(['overridden' => 'pluginConfiguration']);
+        $frontendConfigurationManager->expects(self::at(2))->method('overrideConfigurationFromFlexForm')->with(['overridden' => 'pluginConfiguration'])->willReturn(['overridden' => 'flexFormConfiguration']);
         $expectedResult = ['overridden' => 'flexFormConfiguration'];
         $actualResult = $frontendConfigurationManager->_call(
             'getContextSpecificFrameworkConfiguration',
@@ -564,7 +564,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
      */
     public function overrideStoragePidIfStartingPointIsSetOverridesCorrectly(): void
     {
-        $this->mockContentObject->expects(self::any())->method('getTreeList')->will(self::returnValue('1,2,3'));
+        $this->mockContentObject->expects(self::any())->method('getTreeList')->willReturn('1,2,3');
         $this->mockContentObject->data = ['pages' => '0', 'recursive' => 1];
 
         $frameworkConfiguration = ['persistence' => ['storagePid' => '98']];
@@ -582,7 +582,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
      */
     public function overrideStoragePidIfStartingPointIsSetCorrectlyHandlesEmptyValuesFromGetTreeList(): void
     {
-        $this->mockContentObject->expects(self::any())->method('getTreeList')->will(self::returnValue(''));
+        $this->mockContentObject->expects(self::any())->method('getTreeList')->willReturn('');
         $this->mockContentObject->data = ['pages' => '0', 'recursive' => 1];
 
         $frameworkConfiguration = ['persistence' => ['storagePid' => '98']];
@@ -604,11 +604,11 @@ class FrontendConfigurationManagerTest extends UnitTestCase
         $flexFormService = $this->getMockBuilder(FlexFormService::class)
             ->setMethods(['convertFlexFormContentToArray'])
             ->getMock();
-        $flexFormService->expects(self::once())->method('convertFlexFormContentToArray')->will(self::returnValue([
+        $flexFormService->expects(self::once())->method('convertFlexFormContentToArray')->willReturn([
             'persistence' => [
                 'storagePid' => '0,1,2,3'
             ]
-        ]));
+        ]);
 
         $this->frontendConfigurationManager->_set('flexFormService', $flexFormService);
         $this->mockContentObject->data = ['pi_flexform' => '<XML_ARRAY>'];
@@ -699,7 +699,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
         $frontendConfigurationManager->_set('contentObject', $this->mockContentObject);
         $frontendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
 
-        $this->mockTypoScriptService->expects(self::once())->method('convertTypoScriptArrayToPlainArray')->will(self::returnValue([
+        $this->mockTypoScriptService->expects(self::once())->method('convertTypoScriptArrayToPlainArray')->willReturn([
             'persistence' => [
                 'storagePid' => '0,1,2,3'
             ],
@@ -709,8 +709,8 @@ class FrontendConfigurationManagerTest extends UnitTestCase
             'view' => [
                 'foo' => 'bar'
             ],
-        ]));
-        $frontendConfigurationManager->expects(self::any())->method('getTypoScriptSetup')->will(self::returnValue([
+        ]);
+        $frontendConfigurationManager->expects(self::any())->method('getTypoScriptSetup')->willReturn([
             'plugin.' => [
                 'tx_ext_pi1.' => [
                     'persistence.' => [
@@ -724,7 +724,7 @@ class FrontendConfigurationManagerTest extends UnitTestCase
                     ],
                 ]
             ]
-        ]));
+        ]);
 
         $frameworkConfiguration = [
             'extensionName' => 'ext',
index c33ca8e..682aeb8 100644 (file)
@@ -30,7 +30,7 @@ class BackendUserGroupRepositoryTest extends UnitTestCase
         $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository($objectManager);
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
         $querySettings->expects(self::once())->method('setRespectStoragePage')->with(false);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->initializeObject();
     }
 
@@ -46,7 +46,7 @@ class BackendUserGroupRepositoryTest extends UnitTestCase
             ->setConstructorArgs([$objectManager])
             ->getMock();
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->expects(self::once())->method('setDefaultQuerySettings')->with($querySettings);
         $fixture->initializeObject();
     }
index aaf449d..ce0b436 100644 (file)
@@ -30,7 +30,7 @@ class BackendUserRepositoryTest extends UnitTestCase
         $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository($objectManager);
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
         $querySettings->expects(self::once())->method('setRespectStoragePage')->with(false);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->initializeObject();
     }
 
@@ -46,7 +46,7 @@ class BackendUserRepositoryTest extends UnitTestCase
             ->setConstructorArgs([$objectManager])
             ->getMock();
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->expects(self::once())->method('setDefaultQuerySettings')->with($querySettings);
         $fixture->initializeObject();
     }
index 583d209..731eaa5 100644 (file)
@@ -31,7 +31,7 @@ class CategoryRepositoryTest extends UnitTestCase
         $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository($objectManager);
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
         $querySettings->expects(self::once())->method('setRespectStoragePage')->with(false);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->initializeObject();
     }
 }
index 35105fd..d66de35 100644 (file)
@@ -31,7 +31,7 @@ class FileMountRepositoryTest extends UnitTestCase
         $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\FileMountRepository($objectManager);
         $querySettings = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
         $querySettings->expects(self::once())->method('setRespectStoragePage')->with(false);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->will(self::returnValue($querySettings));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class)->willReturn($querySettings);
         $fixture->initializeObject();
     }
 }
index 0966ff1..ec87946 100644 (file)
@@ -89,7 +89,7 @@ class AbstractControllerTest extends UnitTestCase
         $controllerContext = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class)
             ->setMethods(['getFlashMessageQueue'])
             ->getMock();
-        $controllerContext->expects(self::once())->method('getFlashMessageQueue')->will(self::returnValue($flashMessageQueue));
+        $controllerContext->expects(self::once())->method('getFlashMessageQueue')->willReturn($flashMessageQueue);
 
         $controller = $this->getMockForAbstractClass(
             \TYPO3\CMS\Extbase\Mvc\Controller\AbstractController::class,
index 31bc40a..fa208f9 100644 (file)
@@ -68,7 +68,7 @@ class ActionControllerTest extends UnitTestCase
     public function resolveActionMethodNameReturnsTheCurrentActionMethodNameFromTheRequest()
     {
         $mockRequest = $this->createMock(Request::class);
-        $mockRequest->expects(self::once())->method('getControllerActionName')->will(self::returnValue('fooBar'));
+        $mockRequest->expects(self::once())->method('getControllerActionName')->willReturn('fooBar');
         /** @var \TYPO3\CMS\Extbase\Mvc\Controller\ActionController|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
         $mockController = $this->getAccessibleMock(ActionController::class, ['fooBarAction'], [], '', false);
         $mockController->_set('request', $mockRequest);
@@ -83,7 +83,7 @@ class ActionControllerTest extends UnitTestCase
         $this->expectException(NoSuchActionException::class);
         $this->expectExceptionCode(1186669086);
         $mockRequest = $this->createMock(Request::class);
-        $mockRequest->expects(self::once())->method('getControllerActionName')->will(self::returnValue('fooBar'));
+        $mockRequest->expects(self::once())->method('getControllerActionName')->willReturn('fooBar');
         /** @var \TYPO3\CMS\Extbase\Mvc\Controller\ActionController|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
         $mockController = $this->getAccessibleMock(ActionController::class, ['otherBarAction'], [], '', false);
         $mockController->_set('request', $mockRequest);
@@ -290,7 +290,7 @@ class ActionControllerTest extends UnitTestCase
         $mockController = $this->getAccessibleMock(ActionController::class, ['dummy'], [], '', false);
         /** @var ConfigurationManagerInterface|\PHPUnit_Framework_MockObject_MockObject $mockConfigurationManager */
         $mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($configuration));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($configuration);
         $mockController->injectConfigurationManager($mockConfigurationManager);
         $mockController->_set('request', $this->createMock(Request::class), ['getControllerExtensionKey']);
         $view = $this->getMockBuilder(ViewInterface::class)
@@ -368,7 +368,7 @@ class ActionControllerTest extends UnitTestCase
         $mockController = $this->getAccessibleMock(ActionController::class, ['dummy'], [], '', false);
         /** @var ConfigurationManagerInterface|\PHPUnit_Framework_MockObject_MockObject $mockConfigurationManager */
         $mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($configuration));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($configuration);
         $mockController->injectConfigurationManager($mockConfigurationManager);
         $mockController->_set('request', $this->createMock(Request::class), ['getControllerExtensionKey']);
         $view = $this->getMockBuilder(ViewInterface::class)
@@ -446,7 +446,7 @@ class ActionControllerTest extends UnitTestCase
         $mockController = $this->getAccessibleMock(ActionController::class, ['dummy'], [], '', false);
         /** @var ConfigurationManagerInterface|\PHPUnit_Framework_MockObject_MockObject $mockConfigurationManager */
         $mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($configuration));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($configuration);
         $mockController->injectConfigurationManager($mockConfigurationManager);
         $mockController->_set('request', $this->createMock(Request::class), ['getControllerExtensionKey']);
         $view = $this->getMockBuilder(ViewInterface::class)
index 1fcaa2b..acc5676 100644 (file)
@@ -187,8 +187,8 @@ class ArgumentTest extends UnitTestCase
      */
     protected function setupPropertyMapperAndSetValue()
     {
-        $this->mockPropertyMapper->expects(self::once())->method('convert')->with('someRawValue', 'string', $this->mockConfiguration)->will(self::returnValue('convertedValue'));
-        $this->mockPropertyMapper->expects(self::once())->method('getMessages')->will(self::returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
+        $this->mockPropertyMapper->expects(self::once())->method('convert')->with('someRawValue', 'string', $this->mockConfiguration)->willReturn('convertedValue');
+        $this->mockPropertyMapper->expects(self::once())->method('getMessages')->willReturn(new \TYPO3\CMS\Extbase\Error\Result());
         return $this->simpleValueArgument->setValue('someRawValue');
     }
 
@@ -221,7 +221,7 @@ class ArgumentTest extends UnitTestCase
             ->getMock();
         $validationMessages = new \TYPO3\CMS\Extbase\Error\Result();
         $validationMessages->addError($error);
-        $mockValidator->expects(self::once())->method('validate')->with('convertedValue')->will(self::returnValue($validationMessages));
+        $mockValidator->expects(self::once())->method('validate')->with('convertedValue')->willReturn($validationMessages);
         $this->simpleValueArgument->setValidator($mockValidator);
         $this->setupPropertyMapperAndSetValue();
         self::assertFalse($this->simpleValueArgument->isValid());
index 3139bca..29b03ca 100644 (file)
@@ -52,13 +52,13 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockFirstArgument->expects(self::any())->method('getName')->will(self::returnValue('argumentName1234'));
+        $mockFirstArgument->expects(self::any())->method('getName')->willReturn('argumentName1234');
         $arguments->addArgument($mockFirstArgument);
         $mockSecondArgument = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockSecondArgument->expects(self::any())->method('getName')->will(self::returnValue('argumentName1234'));
+        $mockSecondArgument->expects(self::any())->method('getName')->willReturn('argumentName1234');
         $arguments->addArgument($mockSecondArgument);
         self::assertSame($mockSecondArgument, $arguments->getArgument('argumentName1234'), 'The added and retrieved argument is not the same.');
     }
@@ -70,7 +70,7 @@ class ArgumentsTest extends UnitTestCase
     {
         $mockArgument = $this->createMock(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class);
         $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->will(self::returnValue($mockArgument));
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->willReturn($mockArgument);
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
         $newArgument = $arguments->addNewArgument('someArgument');
@@ -86,7 +86,7 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('argumentName1234'));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('argumentName1234');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         $arguments[] = $mockArgument;
         self::assertTrue($arguments->hasArgument('argumentName1234'), 'Added argument does not exist.');
@@ -102,7 +102,7 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('argumentName1234'));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('argumentName1234');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         $arguments[] = $mockArgument;
         self::assertSame($mockArgument, $arguments['argumentName1234'], 'Argument retrieved by array access is not the one we added.');
@@ -130,7 +130,7 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('argumentName1234'));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('argumentName1234');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         self::assertFalse(isset($arguments['argumentName1234']), 'isset() did not return FALSE.');
         $arguments[] = $mockArgument;
@@ -146,17 +146,17 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument1->expects(self::any())->method('getName')->will(self::returnValue('argumentName1'));
+        $mockArgument1->expects(self::any())->method('getName')->willReturn('argumentName1');
         $mockArgument2 = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument2->expects(self::any())->method('getName')->will(self::returnValue('argumentName2'));
+        $mockArgument2->expects(self::any())->method('getName')->willReturn('argumentName2');
         $mockArgument3 = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument3->expects(self::any())->method('getName')->will(self::returnValue('argumentName3'));
+        $mockArgument3->expects(self::any())->method('getName')->willReturn('argumentName3');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         $arguments[] = $mockArgument1;
         $arguments[] = $mockArgument2;
@@ -174,20 +174,20 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName', 'getShortName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument1->expects(self::any())->method('getName')->will(self::returnValue('argumentName1'));
-        $mockArgument1->expects(self::any())->method('getShortName')->will(self::returnValue('a'));
+        $mockArgument1->expects(self::any())->method('getName')->willReturn('argumentName1');
+        $mockArgument1->expects(self::any())->method('getShortName')->willReturn('a');
         $mockArgument2 = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName', 'getShortName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument2->expects(self::any())->method('getName')->will(self::returnValue('argumentName2'));
-        $mockArgument2->expects(self::any())->method('getShortName')->will(self::returnValue('b'));
+        $mockArgument2->expects(self::any())->method('getName')->willReturn('argumentName2');
+        $mockArgument2->expects(self::any())->method('getShortName')->willReturn('b');
         $mockArgument3 = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName', 'getShortName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument3->expects(self::any())->method('getName')->will(self::returnValue('argumentName3'));
-        $mockArgument3->expects(self::any())->method('getShortName')->will(self::returnValue('c'));
+        $mockArgument3->expects(self::any())->method('getName')->willReturn('argumentName3');
+        $mockArgument3->expects(self::any())->method('getShortName')->willReturn('c');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         $arguments[] = $mockArgument1;
         $arguments[] = $mockArgument2;
@@ -205,9 +205,9 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('dummyName'));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('dummyName');
         $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->will(self::returnValue($mockArgument));
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->willReturn($mockArgument);
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
         $addedArgument = $arguments->addNewArgument('dummyName');
@@ -225,9 +225,9 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('dummyName'));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('dummyName');
         $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->will(self::returnValue($mockArgument));
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->willReturn($mockArgument);
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
         $arguments->addNewArgument('dummyName');
@@ -242,10 +242,10 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName', 'setRequired'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::once())->method('getName')->will(self::returnValue('dummyName'));
+        $mockArgument->expects(self::once())->method('getName')->willReturn('dummyName');
         $mockArgument->expects(self::once())->method('setRequired')->with(true);
         $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->will(self::returnValue($mockArgument));
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->willReturn($mockArgument);
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
         $arguments->addNewArgument('dummyName', 'Text', true);
@@ -260,11 +260,11 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName', 'setRequired', 'setDefaultValue'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument->expects(self::once())->method('getName')->will(self::returnValue('dummyName'));
+        $mockArgument->expects(self::once())->method('getName')->willReturn('dummyName');
         $mockArgument->expects(self::once())->method('setRequired')->with(false);
         $mockArgument->expects(self::once())->method('setDefaultValue')->with('someDefaultValue');
         $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->will(self::returnValue($mockArgument));
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class, 'dummyName', 'Text')->willReturn($mockArgument);
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
         $arguments->addNewArgument('dummyName', 'Text', false, 'someDefaultValue');
@@ -290,12 +290,12 @@ class ArgumentsTest extends UnitTestCase
             ->setMethods(['getName', 'getShortName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument1->expects(self::any())->method('getName')->will(self::returnValue('argumentName1'));
+        $mockArgument1->expects(self::any())->method('getName')->willReturn('argumentName1');
         $mockArgument2 = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)
             ->setMethods(['getName', 'getShortName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockArgument2->expects(self::any())->method('getName')->will(self::returnValue('argumentName2'));
+        $mockArgument2->expects(self::any())->method('getName')->willReturn('argumentName2');
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
         $arguments[] = $mockArgument1;
         $arguments[] = $mockArgument2;
index eccbf8b..6d91781 100644 (file)
@@ -159,7 +159,7 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase
         $hashService = $this->getMockBuilder($this->buildAccessibleProxy(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class))
             ->setMethods(['appendHmac'])
             ->getMock();
-        $hashService->expects(self::once())->method('appendHmac')->with(json_encode($formFieldArray))->will(self::returnValue(json_encode($formFieldArray) . $mockHash));
+        $hashService->expects(self::once())->method('appendHmac')->with(json_encode($formFieldArray))->willReturn(json_encode($formFieldArray) . $mockHash);
 
         $requestHashService = $this->getMockBuilder($this->buildAccessibleProxy(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class))
             ->setMethods(['dummy'])
@@ -177,7 +177,7 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase
     public function initializePropertyMappingConfigurationDoesNothingIfTrustedPropertiesAreNotSet()
     {
         $request = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Request::class)->setMethods(['getInternalArgument'])->disableOriginalConstructor()->getMock();
-        $request->expects(self::any())->method('getInternalArgument')->with('__trustedProperties')->will(self::returnValue(null));
+        $request->expects(self::any())->method('getInternalArgument')->with('__trustedProperties')->willReturn(null);
         $arguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
 
         $requestHashService = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService;
@@ -297,12 +297,12 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase
     protected function initializePropertyMappingConfiguration(array $trustedProperties)
     {
         $request = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\Request::class)->setMethods(['getInternalArgument'])->disableOriginalConstructor()->getMock();
-        $request->expects(self::any())->method('getInternalArgument')->with('__trustedProperties')->will(self::returnValue('fooTrustedProperties'));
+        $request->expects(self::any())->method('getInternalArgument')->with('__trustedProperties')->willReturn('fooTrustedProperties');
 
         $mockHashService = $this->getMockBuilder(\TYPO3\CMS\Extbase\Security\Cryptography\HashService::class)
             ->setMethods(['validateAndStripHmac'])
             ->getMock();
-        $mockHashService->expects(self::once())->method('validateAndStripHmac')->with('fooTrustedProperties')->will(self::returnValue(json_encode($trustedProperties)));
+        $mockHashService->expects(self::once())->method('validateAndStripHmac')->with('fooTrustedProperties')->willReturn(json_encode($trustedProperties));
 
         $requestHashService = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService::class, ['dummy']);
         $requestHashService->_set('hashService', $mockHashService);
@@ -313,8 +313,8 @@ class MvcPropertyMappingConfigurationServiceTest extends UnitTestCase
         $propertyMappingConfiguration = new \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration();
 
         $mockArgument->_set('propertyMappingConfiguration', $propertyMappingConfiguration);
-        $mockArgument->expects(self::any())->method('getName')->will(self::returnValue('foo'));
-        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->will(self::returnValue($mockArgument));
+        $mockArgument->expects(self::any())->method('getName')->willReturn('foo');
+        $mockObjectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Mvc\Controller\Argument::class)->willReturn($mockArgument);
 
         $arguments = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments::class, ['dummy']);
         $arguments->_set('objectManager', $mockObjectManager);
index ea753d3..e265e39 100644 (file)
@@ -219,7 +219,7 @@ class RequestTest extends UnitTestCase
             ->setMethods(['getControllerObjectName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $request->expects(self::once())->method('getControllerObjectName')->will(self::returnValue(''));
+        $request->expects(self::once())->method('getControllerObjectName')->willReturn('');
         $request->setControllerActionName('theAction');
         self::assertEquals('theAction', $request->getControllerActionName());
     }
index 6dbee89..5e9bb87 100644 (file)
@@ -55,7 +55,7 @@ class JsonViewTest extends UnitTestCase
             ->getMock();
         $this->controllerContext = $this->createMock(ControllerContext::class);
         $this->response = $this->createMock(Response::class);
-        $this->controllerContext->expects(self::any())->method('getResponse')->will(self::returnValue($this->response));
+        $this->controllerContext->expects(self::any())->method('getResponse')->willReturn($this->response);
         $this->view->setControllerContext($this->controllerContext);
     }
 
@@ -244,7 +244,7 @@ class JsonViewTest extends UnitTestCase
         $jsonView = $this->getAccessibleMock(JsonView::class, ['dummy'], [], '', false);
         $jsonView->_set('persistenceManager', $persistenceManagerMock);
 
-        $persistenceManagerMock->expects(self::once())->method('getIdentifierByObject')->with($object->value1)->will(self::returnValue($dummyIdentifier));
+        $persistenceManagerMock->expects(self::once())->method('getIdentifierByObject')->with($object->value1)->willReturn($dummyIdentifier);
 
         $actual = $jsonView->_call('transformValue', $object, $configuration);
 
@@ -311,9 +311,9 @@ class JsonViewTest extends UnitTestCase
         $reflectionService = $this->getMockBuilder(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class)
             ->setMethods([ 'getClassNameByObject' ])
             ->getMock();
-        $reflectionService->expects(self::any())->method('getClassNameByObject')->will(self::returnCallback(function ($object) {
+        $reflectionService->expects(self::any())->method('getClassNameByObject')->willReturnCallback(function ($object) {
             return get_class($object);
-        }));
+        });
 
         $jsonView = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\View\JsonView::class, ['dummy'], [], '', false);
         $this->inject($jsonView, 'reflectionService', $reflectionService);
index 86d998a..69eee25 100644 (file)
@@ -111,14 +111,14 @@ class RequestBuilderTest extends UnitTestCase
 
     protected function injectDependencies(): void
     {
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockObjectManager->expects(self::any())->method('get')->with(Request::class)->will(self::returnValue($this->mockRequest));
+        $this->mockObjectManager->expects(self::any())->method('get')->with(Request::class)->willReturn($this->mockRequest);
         $this->requestBuilder->_set('objectManager', $this->mockObjectManager);
         $pluginNamespace = 'tx_' . strtolower($this->configuration['extensionName'] . '_' . $this->configuration['pluginName']);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue($pluginNamespace));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn($pluginNamespace);
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
-        $this->mockEnvironmentService->expects(self::any())->method('getServerRequestMethod')->will(self::returnValue('GET'));
+        $this->mockEnvironmentService->expects(self::any())->method('getServerRequestMethod')->willReturn('GET');
         $this->requestBuilder->_set('environmentService', $this->mockEnvironmentService);
     }
 
@@ -204,7 +204,7 @@ class RequestBuilderTest extends UnitTestCase
         $mockEnvironmentService = $this->getMockBuilder(EnvironmentService::class)
             ->setMethods(['getServerRequestMethod'])
             ->getMock();
-        $mockEnvironmentService->expects(self::once())->method('getServerRequestMethod')->will(self::returnValue($expectedMethod));
+        $mockEnvironmentService->expects(self::once())->method('getServerRequestMethod')->willReturn($expectedMethod);
         $this->requestBuilder->_set('environmentService', $mockEnvironmentService);
         $this->mockRequest->expects(self::once())->method('setMethod')->with($expectedMethod);
         $this->requestBuilder->build();
@@ -219,7 +219,7 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectExceptionCode(1289843275);
         unset($this->configuration['extensionName']);
         $mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
         $this->requestBuilder->build();
     }
@@ -233,7 +233,7 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectExceptionCode(1289843277);
         unset($this->configuration['pluginName']);
         $mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $mockConfigurationManager);
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
@@ -247,7 +247,7 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectException(Exception::class);
         $this->expectExceptionCode(1316104317);
         $this->configuration['controllerConfiguration'] = [];
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
@@ -264,7 +264,7 @@ class RequestBuilderTest extends UnitTestCase
             'className' => 'MyExtension\Controller\TheFirstControllerController',
             'alias' => 'TheFirstController',
         ];
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
@@ -284,7 +284,7 @@ class RequestBuilderTest extends UnitTestCase
                 'actions' => ['foo']
             ]
         ];
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
@@ -396,9 +396,9 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectException(Exception::class);
         $this->expectExceptionCode(1316104317);
         $this->configuration['controllerConfiguration'] = [];
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
     }
@@ -440,9 +440,9 @@ class RequestBuilderTest extends UnitTestCase
     {
         $this->expectException(InvalidControllerNameException::class);
         $this->expectExceptionCode(1313855173);
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $_GET = [
             'tx_myextension_pi1' => [
@@ -460,9 +460,9 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectException(PageNotFoundException::class);
         $this->expectExceptionCode(1313857897);
         $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $_GET = [
             'tx_myextension_pi1' => [
@@ -497,9 +497,9 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectException(Exception::class);
         $this->expectExceptionCode(1316104317);
         $this->configuration['controllerConfiguration'] = [];
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $this->requestBuilder->build();
     }
@@ -557,9 +557,9 @@ class RequestBuilderTest extends UnitTestCase
     {
         $this->expectException(InvalidActionNameException::class);
         $this->expectExceptionCode(1313855175);
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $_GET = [
             'tx_myextension_pi1' => [
@@ -577,9 +577,9 @@ class RequestBuilderTest extends UnitTestCase
         $this->expectException(PageNotFoundException::class);
         $this->expectExceptionCode(1313857898);
         $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
-        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue($this->configuration));
+        $this->mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn($this->configuration);
         $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_myextension_pi1'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_myextension_pi1');
         $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
         $_GET = [
             'tx_myextension_pi1' => [
index 263b166..ddbf94d 100644 (file)
@@ -133,7 +133,7 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForPrefixesArgumentsWithExtensionAndPluginNameAndSetsControllerArgument()
     {
-        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->will(self::returnValue('tx_someextension_someplugin'));
+        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->willReturn('tx_someextension_someplugin');
         $expectedArguments = ['tx_someextension_someplugin' => ['foo' => 'bar', 'baz' => ['extbase' => 'fluid'], 'controller' => 'SomeController']];
         $GLOBALS['TSFE'] = null;
         $this->uriBuilder->uriFor(null, ['foo' => 'bar', 'baz' => ['extbase' => 'fluid']], 'SomeController', 'SomeExtension', 'SomePlugin');
@@ -145,7 +145,7 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForRecursivelyMergesAndOverrulesControllerArgumentsWithArguments()
     {
-        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->will(self::returnValue('tx_someextension_someplugin'));
+        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->willReturn('tx_someextension_someplugin');
         $arguments = ['tx_someextension_someplugin' => ['foo' => 'bar'], 'additionalParam' => 'additionalValue'];
         $controllerArguments = ['foo' => 'overruled', 'baz' => ['extbase' => 'fluid']];
         $expectedArguments = ['tx_someextension_someplugin' => ['foo' => 'overruled', 'baz' => ['extbase' => 'fluid'], 'controller' => 'SomeController'], 'additionalParam' => 'additionalValue'];
@@ -159,7 +159,7 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForOnlySetsActionArgumentIfSpecified()
     {
-        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->will(self::returnValue('tx_someextension_someplugin'));
+        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->willReturn('tx_someextension_someplugin');
         $expectedArguments = ['tx_someextension_someplugin' => ['controller' => 'SomeController']];
         $this->uriBuilder->uriFor(null, [], 'SomeController', 'SomeExtension', 'SomePlugin');
         self::assertEquals($expectedArguments, $this->uriBuilder->getArguments());
@@ -170,8 +170,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForSetsControllerFromRequestIfControllerIsNotSet()
     {
-        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->will(self::returnValue('tx_someextension_someplugin'));
-        $this->mockRequest->expects(self::once())->method('getControllerName')->will(self::returnValue('SomeControllerFromRequest'));
+        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->willReturn('tx_someextension_someplugin');
+        $this->mockRequest->expects(self::once())->method('getControllerName')->willReturn('SomeControllerFromRequest');
         $expectedArguments = ['tx_someextension_someplugin' => ['controller' => 'SomeControllerFromRequest']];
         $this->uriBuilder->uriFor(null, [], null, 'SomeExtension', 'SomePlugin');
         self::assertEquals($expectedArguments, $this->uriBuilder->getArguments());
@@ -182,8 +182,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForSetsExtensionNameFromRequestIfExtensionNameIsNotSet()
     {
-        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->will(self::returnValue('tx_someextensionnamefromrequest_someplugin'));
-        $this->mockRequest->expects(self::once())->method('getControllerExtensionName')->will(self::returnValue('SomeExtensionNameFromRequest'));
+        $this->mockExtensionService->expects(self::any())->method('getPluginNamespace')->willReturn('tx_someextensionnamefromrequest_someplugin');
+        $this->mockRequest->expects(self::once())->method('getControllerExtensionName')->willReturn('SomeExtensionNameFromRequest');
         $expectedArguments = ['tx_someextensionnamefromrequest_someplugin' => ['controller' => 'SomeController']];
         $this->uriBuilder->uriFor(null, [], 'SomeController', null, 'SomePlugin');
         self::assertEquals($expectedArguments, $this->uriBuilder->getArguments());
@@ -194,8 +194,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function uriForSetsPluginNameFromRequestIfPluginNameIsNotSet()
     {
-        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->will(self::returnValue('tx_someextension_somepluginnamefromrequest'));
-        $this->mockRequest->expects(self::once())->method('getPluginName')->will(self::returnValue('SomePluginNameFromRequest'));
+        $this->mockExtensionService->expects(self::once())->method('getPluginNamespace')->willReturn('tx_someextension_somepluginnamefromrequest');
+        $this->mockRequest->expects(self::once())->method('getPluginName')->willReturn('SomePluginNameFromRequest');
         $expectedArguments = ['tx_someextension_somepluginnamefromrequest' => ['controller' => 'SomeController']];
         $this->uriBuilder->uriFor(null, [], 'SomeController', 'SomeExtension');
         self::assertEquals($expectedArguments, $this->uriBuilder->getArguments());
@@ -372,7 +372,7 @@ class UriBuilderTest extends UnitTestCase
         $_SERVER['SCRIPT_NAME'] = '/typo3/index.php';
         $_SERVER['ORIG_SCRIPT_NAME'] = '/typo3/index.php';
         $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
-        $this->mockRequest->expects(self::any())->method('getBaseUri')->will(self::returnValue('http://baseuri'));
+        $this->mockRequest->expects(self::any())->method('getBaseUri')->willReturn('http://baseuri');
         $this->uriBuilder->setCreateAbsoluteUri(true);
         $expectedResult = 'http://baseuri/' . TYPO3_mainDir . 'index.php?route=%2Ftest%2FPath&token=dummyToken';
         $actualResult = $this->uriBuilder->buildBackendUri();
@@ -441,7 +441,7 @@ class UriBuilderTest extends UnitTestCase
         /** @var UriBuilder|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $uriBuilder */
         $uriBuilder = $this->getAccessibleMock(UriBuilder::class, ['buildTypolinkConfiguration']);
         $uriBuilder->_set('contentObject', $this->mockContentObject);
-        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->will(self::returnValue(['someTypoLinkConfiguration']));
+        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->willReturn(['someTypoLinkConfiguration']);
         $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['someTypoLinkConfiguration']);
         $uriBuilder->buildFrontendUri();
     }
@@ -451,7 +451,7 @@ class UriBuilderTest extends UnitTestCase
      */
     public function buildFrontendUriCreatesRelativeUrisByDefault()
     {
-        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->will(self::returnValue('relative/uri'));
+        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->willReturn('relative/uri');
         $expectedResult = 'relative/uri';
         $actualResult = $this->uriBuilder->buildFrontendUri();
         self::assertSame($expectedResult, $actualResult);
@@ -462,7 +462,7 @@ class UriBuilderTest extends UnitTestCase
      */
     public function buildFrontendUriDoesNotStripLeadingSlashesFromRelativeUris()
     {
-        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->will(self::returnValue('/relative/uri'));
+        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->willReturn('/relative/uri');
         $expectedResult = '/relative/uri';
         $actualResult = $this->uriBuilder->buildFrontendUri();
         self::assertSame($expectedResult, $actualResult);
@@ -476,8 +476,8 @@ class UriBuilderTest extends UnitTestCase
         /** @var UriBuilder|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $uriBuilder */
         $uriBuilder = $this->getAccessibleMock(UriBuilder::class, ['buildTypolinkConfiguration']);
         $uriBuilder->_set('contentObject', $this->mockContentObject);
-        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->will(self::returnValue(['foo' => 'bar']));
-        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar', 'forceAbsoluteUrl' => true])->will(self::returnValue('http://baseuri/relative/uri'));
+        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->willReturn(['foo' => 'bar']);
+        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar', 'forceAbsoluteUrl' => true])->willReturn('http://baseuri/relative/uri');
         $uriBuilder->setCreateAbsoluteUri(true);
         $expectedResult = 'http://baseuri/relative/uri';
         $actualResult = $uriBuilder->buildFrontendUri();
@@ -492,8 +492,8 @@ class UriBuilderTest extends UnitTestCase
         /** @var UriBuilder|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $uriBuilder */
         $uriBuilder = $this->getAccessibleMock(UriBuilder::class, ['buildTypolinkConfiguration']);
         $uriBuilder->_set('contentObject', $this->mockContentObject);
-        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->will(self::returnValue(['foo' => 'bar']));
-        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar', 'forceAbsoluteUrl' => true, 'forceAbsoluteUrl.' => ['scheme' => 'someScheme']])->will(self::returnValue('http://baseuri/relative/uri'));
+        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->willReturn(['foo' => 'bar']);
+        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar', 'forceAbsoluteUrl' => true, 'forceAbsoluteUrl.' => ['scheme' => 'someScheme']])->willReturn('http://baseuri/relative/uri');
         $uriBuilder->setCreateAbsoluteUri(true);
         $uriBuilder->setAbsoluteUriScheme('someScheme');
         $expectedResult = 'http://baseuri/relative/uri';
@@ -509,8 +509,8 @@ class UriBuilderTest extends UnitTestCase
         /** @var UriBuilder|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface $uriBuilder */
         $uriBuilder = $this->getAccessibleMock(UriBuilder::class, ['buildTypolinkConfiguration']);
         $uriBuilder->_set('contentObject', $this->mockContentObject);
-        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->will(self::returnValue(['foo' => 'bar']));
-        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar'])->will(self::returnValue('http://baseuri/relative/uri'));
+        $uriBuilder->expects(self::once())->method('buildTypolinkConfiguration')->willReturn(['foo' => 'bar']);
+        $this->mockContentObject->expects(self::once())->method('typoLink_URL')->with(['foo' => 'bar'])->willReturn('http://baseuri/relative/uri');
         $uriBuilder->setCreateAbsoluteUri(false);
         $uriBuilder->setAbsoluteUriScheme('someScheme');
         $expectedResult = 'http://baseuri/relative/uri';
@@ -639,16 +639,16 @@ class UriBuilderTest extends UnitTestCase
     {
         $this->uriBuilder->setTargetPageUid(123);
         $this->uriBuilder->setFormat('txt');
-        $this->mockRequest->expects(self::once())->method('getControllerExtensionName')->will(self::returnValue('SomeExtensionNameFromRequest'));
+        $this->mockRequest->expects(self::once())->method('getControllerExtensionName')->willReturn('SomeExtensionNameFromRequest');
 
         $mockConfigurationManager = $this->createMock(ConfigurationManager::class);
         $mockConfigurationManager->expects(self::any())->method('getConfiguration')
-            ->will(self::returnValue(['formatToPageTypeMapping' => ['txt' => 2]]));
+            ->willReturn(['formatToPageTypeMapping' => ['txt' => 2]]);
         $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
 
         $this->mockExtensionService->expects(self::any())->method('getTargetPageTypeByFormat')
             ->with('SomeExtensionNameFromRequest', 'txt')
-            ->will(self::returnValue(2));
+            ->willReturn(2);
 
         $expectedConfiguration = ['parameter' => '123,2'];
         $actualConfiguration = $this->uriBuilder->_call('buildTypolinkConfiguration');
@@ -664,12 +664,12 @@ class UriBuilderTest extends UnitTestCase
         $this->uriBuilder->setFormat('txt');
 
         $mockConfigurationManager = $this->createMock(ConfigurationManager::class);
-        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->will(self::returnValue([]));
+        $mockConfigurationManager->expects(self::any())->method('getConfiguration')->willReturn([]);
         $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
 
         $this->mockExtensionService->expects(self::any())->method('getTargetPageTypeByFormat')
             ->with(null, 'txt')
-            ->will(self::returnValue(0));
+            ->willReturn(0);
 
         $expectedConfiguration = ['parameter' => '123,0'];
         $actualConfiguration = $this->uriBuilder->_call('buildTypolinkConfiguration');
@@ -687,12 +687,12 @@ class UriBuilderTest extends UnitTestCase
 
         $mockConfigurationManager = $this->createMock(ConfigurationManager::class);
         $mockConfigurationManager->expects(self::any())->method('getConfiguration')
-            ->will(self::returnValue(['formatToPageTypeMapping' => ['pdf' => 2]]));
+            ->willReturn(['formatToPageTypeMapping' => ['pdf' => 2]]);
         $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
 
         $this->mockExtensionService->expects(self::any())->method('getTargetPageTypeByFormat')
             ->with(null, 'txt')
-            ->will(self::returnValue(0));
+            ->willReturn(0);
 
         $expectedConfiguration = ['parameter' => '123,0'];
         $actualConfiguration = $this->uriBuilder->_call('buildTypolinkConfiguration');
@@ -773,7 +773,7 @@ class UriBuilderTest extends UnitTestCase
         $mockValueObject->name = 'foo';
         /** @var UriBuilder|\PHPUnit_Framework_MockObject_MockObject|object $mockUriBuilder */
         $mockUriBuilder = $this->getAccessibleMock(UriBuilder::class, ['convertTransientObjectToArray']);
-        $mockUriBuilder->expects(self::once())->method('convertTransientObjectToArray')->will(self::returnValue(['foo' => 'bar']));
+        $mockUriBuilder->expects(self::once())->method('convertTransientObjectToArray')->willReturn(['foo' => 'bar']);
         $actualResult = $mockUriBuilder->_call('convertDomainObjectsToIdentityArrays', ['object' => $mockValueObject]);
         $expectedResult = ['object' => ['foo' => 'bar']];
         self::assertEquals($expectedResult, $actualResult);
@@ -869,8 +869,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function removeDefaultControllerAndActionDoesNotModifyArgumentsifSpecifiedControlerAndActionIsNotEqualToDefaults()
     {
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->will(self::returnValue('DefaultController'));
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'SomeController')->will(self::returnValue('defaultAction'));
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->willReturn('DefaultController');
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'SomeController')->willReturn('defaultAction');
         $arguments = ['controller' => 'SomeController', 'action' => 'someAction', 'foo' => 'bar'];
         $extensionName = 'ExtensionName';
         $pluginName = 'PluginName';
@@ -884,8 +884,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function removeDefaultControllerAndActionRemovesControllerIfItIsEqualToTheDefault()
     {
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->will(self::returnValue('DefaultController'));
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'DefaultController')->will(self::returnValue('defaultAction'));
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->willReturn('DefaultController');
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'DefaultController')->willReturn('defaultAction');
         $arguments = ['controller' => 'DefaultController', 'action' => 'someAction', 'foo' => 'bar'];
         $extensionName = 'ExtensionName';
         $pluginName = 'PluginName';
@@ -899,8 +899,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function removeDefaultControllerAndActionRemovesActionIfItIsEqualToTheDefault()
     {
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->will(self::returnValue('DefaultController'));
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'SomeController')->will(self::returnValue('defaultAction'));
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->willReturn('DefaultController');
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'SomeController')->willReturn('defaultAction');
         $arguments = ['controller' => 'SomeController', 'action' => 'defaultAction', 'foo' => 'bar'];
         $extensionName = 'ExtensionName';
         $pluginName = 'PluginName';
@@ -914,8 +914,8 @@ class UriBuilderTest extends UnitTestCase
      */
     public function removeDefaultControllerAndActionRemovesControllerAndActionIfBothAreEqualToTheDefault()
     {
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->will(self::returnValue('DefaultController'));
-        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'DefaultController')->will(self::returnValue('defaultAction'));
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultControllerNameByPlugin')->with('ExtensionName', 'PluginName')->willReturn('DefaultController');
+        $this->mockExtensionService->expects(self::atLeastOnce())->method('getDefaultActionNameByPluginAndController')->with('ExtensionName', 'PluginName', 'DefaultController')->willReturn('defaultAction');
         $arguments = ['controller' => 'DefaultController', 'action' => 'defaultAction', 'foo' => 'bar'];
         $extensionName = 'ExtensionName';
         $pluginName = 'PluginName';
index bd5c842..1f92ae1 100644 (file)
@@ -59,15 +59,15 @@ class ContainerTest extends UnitTestCase
         $psrContainer = $this->getMockBuilder(\Psr\Container\ContainerInterface::class)
             ->setMethods(['has', 'get'])
             ->getMock();
-        $psrContainer->expects(self::any())->method('has')->will(self::returnValue(false));
+        $psrContainer->expects(self::any())->method('has')->willReturn(false);
         $psrContainer->expects(self::any())->method('get')->will(self::throwException($notFoundException));
 
         $this->subject = $this->getMockBuilder(Container::class)
             ->setConstructorArgs([$psrContainer])
             ->setMethods(['getLogger', 'getReflectionService'])
             ->getMock();
-        $this->subject->expects(self::any())->method('getLogger')->will(self::returnValue($this->logger));
-        $this->subject->expects(self::any())->method('getReflectionService')->will(self::returnValue($reflectionService));
+        $this->subject->expects(self::any())->method('getLogger')->willReturn($this->logger);
+        $this->subject->expects(self::any())->method('getReflectionService')->willReturn($reflectionService);
     }
 
     /**
index 0f1465e..9685247 100644 (file)
@@ -67,23 +67,23 @@ class BackendTest extends UnitTestCase
         $columnMap
             ->expects(self::once())
             ->method('getRelationTableName')
-            ->will(self::returnValue('myTable'));
+            ->willReturn('myTable');
         $columnMap
             ->expects(self::once())
             ->method('getRelationTableMatchFields')
-            ->will(self::returnValue($mmMatchFields));
+            ->willReturn($mmMatchFields);
         $columnMap
             ->expects(self::any())
             ->method('getChildSortByFieldName')
-            ->will(self::returnValue(''));
+            ->willReturn('');
         $dataMap
             ->expects(self::any())
             ->method('getColumnMap')
-            ->will(self::returnValue($columnMap));
+            ->willReturn($columnMap);
         $dataMapFactory
             ->expects(self::any())
             ->method('buildDataMap')
-            ->will(self::returnValue($dataMap));
+            ->willReturn($dataMap);
         $storageBackend
             ->expects(self::once())
             ->method('addRow')
@@ -110,7 +110,7 @@ class BackendTest extends UnitTestCase
         $referenceIndexProphecy = $this->prophesize(ReferenceIndex::class);
         GeneralUtility::addInstance(ReferenceIndex::class, $referenceIndexProphecy->reveal());
 
-        $session->expects(self::once())->method('getIdentifierByObject')->with($object)->will(self::returnValue($fakeUuid));
+        $session->expects(self::once())->method('getIdentifierByObject')->with($object)->willReturn($fakeUuid);
 
         /** @var Backend $backend */
         $backend = $this->getAccessibleMock(Backend::class, ['dummy'], [$configurationManager], '', false);
@@ -141,8 +141,8 @@ class BackendTest extends UnitTestCase
         $referenceIndexProphecy = $this->prophesize(ReferenceIndex::class);
         GeneralUtility::addInstance(ReferenceIndex::class, $referenceIndexProphecy->reveal());
 
-        $proxy->expects(self::once())->method('_loadRealInstance')->will(self::returnValue($object));
-        $session->expects(self::once())->method('getIdentifierByObject')->with($object)->will(self::returnValue($fakeUuid));
+        $proxy->expects(self::once())->method('_loadRealInstance')->willReturn($object);
+        $session->expects(self::once())->method('getIdentifierByObject')->with($object)->willReturn($fakeUuid);
 
         /** @var Backend $backend */
         $backend = $this->getAccessibleMock(Backend::class, ['dummy'], [$configurationManager], '', false);
index 678e34c..b5a5db6 100644 (file)
@@ -52,7 +52,7 @@ class DataMapFactoryTest extends UnitTestCase
         $type = $className;
         $elementType = null;
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['setOneToOneRelation', 'setOneToManyRelation', 'setManyToManyRelation'], [], '', false);
-        $mockDataMapFactory->expects(self::once())->method('setOneToOneRelation')->will(self::returnValue($mockColumnMap));
+        $mockDataMapFactory->expects(self::once())->method('setOneToOneRelation')->willReturn($mockColumnMap);
         $mockDataMapFactory->expects(self::never())->method('setOneToManyRelation');
         $mockDataMapFactory->expects(self::never())->method('setManyToManyRelation');
         $mockDataMapFactory->_callRef('setRelations', $mockColumnMap, $columnConfiguration, $type, $elementType);
@@ -120,7 +120,7 @@ class DataMapFactoryTest extends UnitTestCase
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['setOneToOneRelation', 'setOneToManyRelation', 'setManyToManyRelation'], [], '', false);
         $mockDataMapFactory->expects(self::never())->method('setOneToOneRelation');
         $mockDataMapFactory->expects(self::never())->method('setOneToManyRelation');
-        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->will(self::returnValue($mockColumnMap));
+        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->willReturn($mockColumnMap);
         $mockDataMapFactory->_callRef('setRelations', $mockColumnMap, $columnConfiguration, $type, $elementType);
     }
 
@@ -140,7 +140,7 @@ class DataMapFactoryTest extends UnitTestCase
         $elementType = 'Tx_Myext_Domain_Model_Foo';
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['setOneToOneRelation', 'setOneToManyRelation', 'setManyToManyRelation'], [], '', false);
         $mockDataMapFactory->expects(self::never())->method('setOneToOneRelation');
-        $mockDataMapFactory->expects(self::once())->method('setOneToManyRelation')->will(self::returnValue($mockColumnMap));
+        $mockDataMapFactory->expects(self::once())->method('setOneToManyRelation')->willReturn($mockColumnMap);
         $mockDataMapFactory->expects(self::never())->method('setManyToManyRelation');
         $mockDataMapFactory->_callRef('setRelations', $mockColumnMap, $columnConfiguration, $type, $elementType);
     }
@@ -226,7 +226,7 @@ class DataMapFactoryTest extends UnitTestCase
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['setOneToOneRelation', 'setOneToManyRelation', 'setManyToManyRelation'], [], '', false);
         $mockDataMapFactory->expects(self::never())->method('setOneToOneRelation');
         $mockDataMapFactory->expects(self::never())->method('setOneToManyRelation');
-        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->will(self::returnValue($mockColumnMap));
+        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->willReturn($mockColumnMap);
         $mockDataMapFactory->_callRef('setRelations', $mockColumnMap, $columnConfiguration, $type, $elementType);
     }
 
@@ -246,7 +246,7 @@ class DataMapFactoryTest extends UnitTestCase
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['setOneToOneRelation', 'setOneToManyRelation', 'setManyToManyRelation'], [], '', false);
         $mockDataMapFactory->expects(self::never())->method('setOneToOneRelation');
         $mockDataMapFactory->expects(self::never())->method('setOneToManyRelation');
-        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->will(self::returnValue($mockColumnMap));
+        $mockDataMapFactory->expects(self::once())->method('setManyToManyRelation')->willReturn($mockColumnMap);
         $mockDataMapFactory->_callRef('setRelations', $mockColumnMap, $columnConfiguration, $type, $elementType);
     }
 
@@ -349,10 +349,10 @@ class DataMapFactoryTest extends UnitTestCase
         ];
         $mockColumnMap = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::class);
         $mockColumnMap->expects(self::once())->method('setRelationTableName')->with(self::equalTo('tx_myextension_mm'));
-        $mockColumnMap->expects(self::once())->method('getRelationTableName')->will(self::returnValue('tx_myextension_mm'));
+        $mockColumnMap->expects(self::once())->method('getRelationTableName')->willReturn('tx_myextension_mm');
         $mockColumnMap->expects(self::never())->method('setrelationTablePageIdColumnName');
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['getControlSection'], [], '', false);
-        $mockDataMapFactory->expects(self::once())->method('getControlSection')->with(self::equalTo('tx_myextension_mm'))->will(self::returnValue(null));
+        $mockDataMapFactory->expects(self::once())->method('getControlSection')->with(self::equalTo('tx_myextension_mm'))->willReturn(null);
         $mockDataMapFactory->_callRef('setManyToManyRelation', $mockColumnMap, $leftColumnsDefinition['rights']);
     }
 
@@ -371,10 +371,10 @@ class DataMapFactoryTest extends UnitTestCase
         ];
         $mockColumnMap = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::class);
         $mockColumnMap->expects(self::once())->method('setRelationTableName')->with(self::equalTo('tx_myextension_mm'));
-        $mockColumnMap->expects(self::once())->method('getRelationTableName')->will(self::returnValue('tx_myextension_mm'));
+        $mockColumnMap->expects(self::once())->method('getRelationTableName')->willReturn('tx_myextension_mm');
         $mockColumnMap->expects(self::once())->method('setrelationTablePageIdColumnName')->with(self::equalTo('pid'));
         $mockDataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['getControlSection'], [], '', false);
-        $mockDataMapFactory->expects(self::once())->method('getControlSection')->with(self::equalTo('tx_myextension_mm'))->will(self::returnValue(['ctrl' => ['foo' => 'bar']]));
+        $mockDataMapFactory->expects(self::once())->method('getControlSection')->with(self::equalTo('tx_myextension_mm'))->willReturn(['ctrl' => ['foo' => 'bar']]);
         $mockDataMapFactory->_callRef('setManyToManyRelation', $mockColumnMap, $leftColumnsDefinition['rights']);
     }
 
@@ -438,7 +438,7 @@ class DataMapFactoryTest extends UnitTestCase
             ->setMethods(['get'])
             ->disableOriginalConstructor()
             ->getMock();
-        $cacheMock->expects(self::any())->method('get')->will(self::returnValue(false));
+        $cacheMock->expects(self::any())->method('get')->willReturn(false);
         $mockDataMapFactory->_set('dataMapCache', $cacheMock);
         $mockDataMapFactory->buildDataMap('UnknownObject');
     }
@@ -485,14 +485,14 @@ class DataMapFactoryTest extends UnitTestCase
 
         /** @var $configurationManager \TYPO3\CMS\Extbase\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject */
         $configurationManager = $this->createMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
-        $configurationManager->expects(self::once())->method('getConfiguration')->with('Framework')->will(self::returnValue($configuration));
+        $configurationManager->expects(self::once())->method('getConfiguration')->with('Framework')->willReturn($configuration);
         /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory $dataMapFactory */
         $dataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['test']);
         $dataMapFactory->_set('reflectionService', new \TYPO3\CMS\Extbase\Reflection\ReflectionService());
         $dataMapFactory->_set('objectManager', $objectManager);
         $dataMapFactory->_set('configurationManager', $configurationManager);
         $cacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class);
-        $cacheMock->expects(self::any())->method('get')->will(self::returnValue(false));
+        $cacheMock->expects(self::any())->method('get')->willReturn(false);
         $dataMapFactory->_set('dataMapCache', $cacheMock);
         $dataMap = $dataMapFactory->buildDataMap(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser::class);
         self::assertSame($expectedSubclasses, $dataMap->getSubclasses());
@@ -534,7 +534,7 @@ class DataMapFactoryTest extends UnitTestCase
         $columnMap = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::class)
             ->setConstructorArgs(['column', 'property'])
             ->getMock();
-        $objectManager->expects(self::once())->method('get')->will(self::returnValue($columnMap));
+        $objectManager->expects(self::once())->method('get')->willReturn($columnMap);
 
         $dataMapFactory->_set('objectManager', $objectManager);
 
index 34f94f1..a0474a7 100644 (file)
@@ -55,8 +55,8 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['mapSingleRow', 'getTargetType'])
             ->getMock();
 
-        $dataMapper->expects(self::any())->method('getTargetType')->will(self::returnArgument(1));
-        $dataMapper->expects(self::once())->method('mapSingleRow')->with($rows[0])->will(self::returnValue($object));
+        $dataMapper->expects(self::any())->method('getTargetType')->willReturnArgument(1);
+        $dataMapper->expects(self::once())->method('mapSingleRow')->with($rows[0])->willReturn($object);
 
         $dataMapper->map(get_class($object), $rows);
     }
@@ -73,8 +73,8 @@ class DataMapperTest extends UnitTestCase
         $row = ['uid' => '1234'];
         $object = new \stdClass();
         $persistenceSession = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Session::class);
-        $persistenceSession->expects(self::once())->method('hasIdentifier')->with('1234')->will(self::returnValue(true));
-        $persistenceSession->expects(self::once())->method('getObjectByIdentifier')->with('1234')->will(self::returnValue($object));
+        $persistenceSession->expects(self::once())->method('hasIdentifier')->with('1234')->willReturn(true);
+        $persistenceSession->expects(self::once())->method('getObjectByIdentifier')->with('1234')->willReturn($object);
 
         $dataMapper = $this->getAccessibleMock(
             DataMapper::class,
@@ -128,7 +128,7 @@ class DataMapperTest extends UnitTestCase
         $mockReflectionService = $this->getMockBuilder(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class)
             ->setMethods(['getClassSchema'])
             ->getMock();
-        $mockReflectionService->expects(self::any())->method('getClassSchema')->will(self::returnValue($classSchema));
+        $mockReflectionService->expects(self::any())->method('getClassSchema')->willReturn($classSchema);
         $dataMapFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::class, ['dummy'], [], '', false);
         $dataMapFactory->_set('dataMaps', $dataMaps);
         $dataMapper = $this->getAccessibleMock(
@@ -168,9 +168,9 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['getColumnMap'])
             ->disableOriginalConstructor()
             ->getMock();
-        $dataMap->expects(self::any())->method('getColumnMap')->will(self::returnValue($columnMap));
+        $dataMap->expects(self::any())->method('getColumnMap')->willReturn($columnMap);
         $dataMapper = $this->getAccessibleMock(DataMapper::class, ['getDataMap'], [], '', false);
-        $dataMapper->expects(self::any())->method('getDataMap')->will(self::returnValue($dataMap));
+        $dataMapper->expects(self::any())->method('getDataMap')->willReturn($dataMap);
         $result = $dataMapper->_call('fetchRelatedEager', $this->createMock(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class), 'SomeName', '');
         self::assertEquals(null, $result);
     }
@@ -191,9 +191,9 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['getColumnMap'])
             ->disableOriginalConstructor()
             ->getMock();
-        $dataMap->expects(self::any())->method('getColumnMap')->will(self::returnValue($columnMap));
+        $dataMap->expects(self::any())->method('getColumnMap')->willReturn($columnMap);
         $dataMapper = $this->getAccessibleMock(DataMapper::class, ['getDataMap'], [], '', false);
-        $dataMapper->expects(self::any())->method('getDataMap')->will(self::returnValue($dataMap));
+        $dataMapper->expects(self::any())->method('getDataMap')->willReturn($dataMap);
         $result = $dataMapper->_call('fetchRelatedEager', $this->createMock(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class), 'SomeName', '');
         self::assertEquals([], $result);
     }
@@ -215,9 +215,9 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['getColumnMap'])
             ->disableOriginalConstructor()
             ->getMock();
-        $dataMap->expects(self::any())->method('getColumnMap')->will(self::returnValue($columnMap));
+        $dataMap->expects(self::any())->method('getColumnMap')->willReturn($columnMap);
         $dataMapper = $this->getAccessibleMock(DataMapper::class, ['getDataMap', 'fetchRelated'], [], '', false);
-        $dataMapper->expects(self::any())->method('getDataMap')->will(self::returnValue($dataMap));
+        $dataMapper->expects(self::any())->method('getDataMap')->willReturn($dataMap);
         $dataMapper->expects(self::never())->method('fetchRelated');
         $result = $dataMapper->_call('mapObjectToClassProperty', $this->createMock(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class), 'SomeName', '');
         self::assertEquals(null, $result);
@@ -253,7 +253,7 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['has', 'get'])
             ->disableOriginalConstructor()
             ->getMock();
-        $psrContainer->expects(self::any())->method('has')->will(self::returnValue(false));
+        $psrContainer->expects(self::any())->method('has')->willReturn(false);
         $container = new Container($psrContainer);
 
         $session = new \TYPO3\CMS\Extbase\Persistence\Generic\Session(new Container($psrContainer));
@@ -263,9 +263,9 @@ class DataMapperTest extends UnitTestCase
             ->setMethods(['getClassSchema'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockReflectionService->expects(self::any())->method('getClassSchema')->will(self::returnValue($classSchema1));
+        $mockReflectionService->expects(self::any())->method('getClassSchema')->willReturn($classSchema1);
 
-        $dataMap->expects(self::any())->method('getColumnMap')->will(self::returnValue($columnMap));
+        $dataMap->expects(self::any())->method('getColumnMap')->willReturn($columnMap);
 
         $dataMapper = $this->getAccessibleMock(
             DataMapper::class,
@@ -280,7 +280,7 @@ class DataMapperTest extends UnitTestCase
                 $this->createMock(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class),
             ]
         );
-        $dataMapper->expects(self::any())->method('getDataMap')->will(self::returnValue($dataMap));
+        $dataMapper->expects(self::any())->method('getDataMap')->willReturn($dataMap);
         $dataMapper->expects(self::never())->method('getNonEmptyRelationValue');
         $result = $dataMapper->_call('mapObjectToClassProperty', $object, 'relationProperty', $identifier);
         self::assertEquals($child, $result);
@@ -409,7 +409,7 @@ class DataMapperTest extends UnitTestCase
         /** @var DataMapper $dataMapper */
         $dataMapper = $this->createPartialMock(DataMapper::class, []);
         $input = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy::class);
-        $input->expects(self::once())->method('_loadRealInstance')->will(self::returnValue($dataMapper));
+        $input->expects(self::once())->method('_loadRealInstance')->willReturn($dataMapper);
         $dataMapper->getPlainValue($input);
     }
 
@@ -422,7 +422,7 @@ class DataMapperTest extends UnitTestCase
         $dataMapper = $this->createPartialMock(DataMapper::class, []);
         $input = $this->createMock(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface::class);
 
-        $input->expects(self::once())->method('getUid')->will(self::returnValue(23));
+        $input->expects(self::once())->method('getUid')->willReturn(23);
         self::assertSame(23, $dataMapper->getPlainValue($input));
     }
 }
index 80eedff..ad7af13 100644 (file)
@@ -97,7 +97,7 @@ class PersistenceManagerTest extends UnitTestCase
         $object = new \stdClass();
 
         $mockBackend = $this->createMock(BackendInterface::class);
-        $mockBackend->expects(self::once())->method('getIdentifierByObject')->with($object)->will(self::returnValue($fakeUuid));
+        $mockBackend->expects(self::once())->method('getIdentifierByObject')->with($object)->willReturn($fakeUuid);
 
         $manager = new PersistenceManager(
             $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface::class),
@@ -117,8 +117,8 @@ class PersistenceManagerTest extends UnitTestCase
         $object = new \stdClass();
 
         $mockSession = $this->createMock(Session::class);
-        $mockSession->expects(self::once())->method('hasIdentifier')->with($fakeUuid)->will(self::returnValue(true));
-        $mockSession->expects(self::once())->method('getObjectByIdentifier')->with($fakeUuid)->will(self::returnValue($object));
+        $mockSession->expects(self::once())->method('hasIdentifier')->with($fakeUuid)->willReturn(true);
+        $mockSession->expects(self::once())->method('getObjectByIdentifier')->with($fakeUuid)->willReturn($object);
 
         $manager = new PersistenceManager(
             $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface::class),
@@ -139,13 +139,13 @@ class PersistenceManagerTest extends UnitTestCase
         $fakeEntityType = get_class($object);
 
         $mockSession = $this->createMock(Session::class);
-        $mockSession->expects(self::once())->method('hasIdentifier')->with($fakeUuid)->will(self::returnValue(false));
+        $mockSession->expects(self::once())->method('hasIdentifier')->with($fakeUuid)->willReturn(false);
 
         $mockBackend = $this->createMock(BackendInterface::class);
         $mockBackend->expects(self::once())->method('getObjectByIdentifier')->with(
             $fakeUuid,
             $fakeEntityType
-        )->will(self::returnValue($object));
+        )->willReturn($object);
 
         $manager = new PersistenceManager(
             $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface::class),
@@ -168,13 +168,13 @@ class PersistenceManagerTest extends UnitTestCase
         $mockSession->expects(self::once())->method('hasIdentifier')->with(
             $fakeUuid,
             $fakeEntityType
-        )->will(self::returnValue(false));
+        )->willReturn(false);
 
         $mockBackend = $this->createMock(BackendInterface::class);
         $mockBackend->expects(self::once())->method('getObjectByIdentifier')->with(
             $fakeUuid,
             $fakeEntityType
-        )->will(self::returnValue(null));
+        )->willReturn(null);
 
         $manager = new PersistenceManager(
             $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface::class),
@@ -340,7 +340,7 @@ class PersistenceManagerTest extends UnitTestCase
             ->setMethods(['has', 'get'])
             ->disableOriginalConstructor()
             ->getMock();
-        $psrContainer->expects(self::any())->method('has')->will(self::returnValue(false));
+        $psrContainer->expects(self::any())->method('has')->willReturn(false);
         $session = new Session(new Container($psrContainer));
         $changedEntities = new ObjectStorage();
         $entity1 = new $classNameWithNamespace();
@@ -379,7 +379,7 @@ class PersistenceManagerTest extends UnitTestCase
         $mockObject->Persistence_Object_Identifier = 'abcdefg';
 
         $mockSession = $this->createMock(Session::class);
-        $mockSession->expects(self::any())->method('hasIdentifier')->will(self::returnValue(false));
+        $mockSession->expects(self::any())->method('hasIdentifier')->willReturn(false);
         $mockBackend = $this->createMock(BackendInterface::class);
 
         $persistenceManager = new PersistenceManager(
index fb46440..929395a 100644 (file)
@@ -61,7 +61,7 @@ class QueryFactoryTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->setMethods(['buildDataMap', 'convertClassNameToTableName'])
             ->getMock();
-        $this->dataMapFactory->expects(self::any())->method('buildDataMap')->will(self::returnValue($this->dataMap));
+        $this->dataMapFactory->expects(self::any())->method('buildDataMap')->willReturn($this->dataMap);
 
         $this->queryFactory = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory(
             $this->objectManager,
@@ -90,18 +90,18 @@ class QueryFactoryTest extends UnitTestCase
      */
     public function createDoesNotRespectStoragePageIfStaticOrRootLevelIsTrue($static, $rootLevel, $expectedResult)
     {
-        $this->dataMap->expects(self::any())->method('getIsStatic')->will(self::returnValue($static));
-        $this->dataMap->expects(self::any())->method('getRootLevel')->will(self::returnValue($rootLevel));
+        $this->dataMap->expects(self::any())->method('getIsStatic')->willReturn($static);
+        $this->dataMap->expects(self::any())->method('getRootLevel')->willReturn($rootLevel);
 
         $query = $this->createMock(\TYPO3\CMS\Extbase\Persistence\QueryInterface::class);
         $this->objectManager->expects(self::at(0))->method('get')
             ->with(\TYPO3\CMS\Extbase\Persistence\QueryInterface::class)
-            ->will(self::returnValue($query));
+            ->willReturn($query);
 
         $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
         $this->objectManager->expects(self::at(1))->method('get')
             ->with(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class)
-            ->will(self::returnValue($querySettings));
+            ->willReturn($querySettings);
         $query->expects(self::once())->method('setQuerySettings')->with($querySettings);
         $this->queryFactory->create($this->className);
 
index 65295c0..9cea597 100644 (file)
@@ -53,15 +53,15 @@ class QueryResultTest extends UnitTestCase
     {
         parent::setUp();
         $this->mockPersistenceManager = $this->createMock(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
-        $this->mockPersistenceManager->expects(self::any())->method('getObjectDataByQuery')->will(self::returnValue(['one', 'two']));
-        $this->mockPersistenceManager->expects(self::any())->method('getObjectCountByQuery')->will(self::returnValue(2));
+        $this->mockPersistenceManager->expects(self::any())->method('getObjectDataByQuery')->willReturn(['one', 'two']);
+        $this->mockPersistenceManager->expects(self::any())->method('getObjectCountByQuery')->willReturn(2);
         $this->mockDataMapper = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class);
         $this->mockQuery = $this->createMock(\TYPO3\CMS\Extbase\Persistence\QueryInterface::class);
         $this->queryResult = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult::class, ['dummy'], [$this->mockQuery]);
         $this->queryResult->_set('persistenceManager', $this->mockPersistenceManager);
         $this->queryResult->_set('dataMapper', $this->mockDataMapper);
         $this->sampleResult = [['foo' => 'Foo1', 'bar' => 'Bar1'], ['foo' => 'Foo2', 'bar' => 'Bar2']];
-        $this->mockDataMapper->expects(self::any())->method('map')->will(self::returnValue($this->sampleResult));
+        $this->mockDataMapper->expects(self::any())->method('map')->willReturn($this->sampleResult);
     }
 
     /**
@@ -154,7 +154,7 @@ class QueryResultTest extends UnitTestCase
      */
     public function countOnlyCallsGetObjectCountByQueryOnPersistenceManagerOnce()
     {
-        $this->mockPersistenceManager->expects(self::once())->method('getObjectCountByQuery')->will(self::returnValue(2));
+        $this->mockPersistenceManager->expects(self::once())->method('getObjectCountByQuery')->willReturn(2);
         $this->queryResult->count();
         self::assertEquals(2, $this->queryResult->count());
     }
@@ -190,7 +190,7 @@ class QueryResultTest extends UnitTestCase
         $queryResult = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult::class, ['dummy'], [$this->mockQuery]);
         $queryResult->_set('persistenceManager', $this->mockPersistenceManager);
         $queryResult->_set('dataMapper', $this->mockDataMapper);
-        $this->mockPersistenceManager->expects(self::once())->method('getObjectDataByQuery')->with($this->mockQuery)->will(self::returnValue(['FAKERESULT']));
+        $this->mockPersistenceManager->expects(self::once())->method('getObjectDataByQuery')->with($this->mockQuery)->willReturn(['FAKERESULT']);
         $queryResult->_call('initialize');
     }
 
index 2d4fdee..c31375a 100644 (file)
@@ -65,7 +65,7 @@ class QueryTest extends UnitTestCase
         $objectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         $this->query->_set('objectManager', $objectManager);
         $queryResult = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult::class);
-        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface::class, $this->query)->will(self::returnValue($queryResult));
+        $objectManager->expects(self::once())->method('get')->with(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface::class, $this->query)->willReturn($queryResult);
         $actualResult = $this->query->execute();
         self::assertSame($queryResult, $actualResult);
     }
@@ -75,7 +75,7 @@ class QueryTest extends UnitTestCase
      */
     public function executeReturnsRawObjectDataIfReturnRawQueryResultIsSet()
     {
-        $this->persistenceManager->expects(self::once())->method('getObjectDataByQuery')->with($this->query)->will(self::returnValue('rawQueryResult'));
+        $this->persistenceManager->expects(self::once())->method('getObjectDataByQuery')->with($this->query)->willReturn('rawQueryResult');
         $expectedResult = 'rawQueryResult';
         $actualResult = $this->query->execute(true);
         self::assertEquals($expectedResult, $actualResult);
@@ -149,12 +149,12 @@ class QueryTest extends UnitTestCase
         $objectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
         /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $dynamicOperand */
         $dynamicOperand = $this->createMock(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValueInterface::class);
-        $objectManager->expects(self::any())->method('get')->will(self::returnValue($dynamicOperand));
+        $objectManager->expects(self::any())->method('get')->willReturn($dynamicOperand);
         /** @var $qomFactory \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory */
         $qomFactory = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory::class, ['comparison']);
         $qomFactory->_set('objectManager', $objectManager);
         $qomFactory->expects(self::once())->method('comparison')->with(self::anything(), self::anything(), $expectedOperand);
-        $this->query->expects(self::any())->method('getSelectorName')->will(self::returnValue('someSelector'));
+        $this->query->expects(self::any())->method('getSelectorName')->willReturn('someSelector');
         $this->query->_set('qomFactory', $qomFactory);
         $this->query->equals($propertyName, $operand, false);
     }
index 597cef2..2d7b8e1 100644 (file)
@@ -25,7 +25,7 @@ class SessionTest extends UnitTestCase
     protected function createContainer(): Container
     {
         $psrContainer = $this->getMockBuilder(\Psr\Container\ContainerInterface::class)->setMethods(['has', 'get'])->getMock();
-        $psrContainer->expects(self::any())->method('has')->will(self::returnValue(false));
+        $psrContainer->expects(self::any())->method('has')->willReturn(false);
         return new Container($psrContainer);
     }
 
index de9e512..77b5710 100644 (file)
@@ -65,28 +65,28 @@ class Typo3DbBackendTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->getMock();
         $mockValueObject->expects(self::once())->method('_getProperties')
-            ->will(self::returnValue(['propertyName' => 'propertyValue']));
+            ->willReturn(['propertyName' => 'propertyValue']);
         $mockColumnMap = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap::class)
             ->setMethods(['isPersistableProperty', 'getColumnName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockColumnMap->expects(self::any())->method('getColumnName')->will(self::returnValue('column_name'));
+        $mockColumnMap->expects(self::any())->method('getColumnName')->willReturn('column_name');
         $tableName = 'tx_foo_table';
         $mockDataMap = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap::class)
             ->setMethods(['isPersistableProperty', 'getColumnMap', 'getTableName'])
             ->disableOriginalConstructor()
             ->getMock();
-        $mockDataMap->expects(self::any())->method('isPersistableProperty')->will(self::returnValue(true));
-        $mockDataMap->expects(self::any())->method('getColumnMap')->will(self::returnValue($mockColumnMap));
-        $mockDataMap->expects(self::any())->method('getTableName')->will(self::returnValue($tableName));
+        $mockDataMap->expects(self::any())->method('isPersistableProperty')->willReturn(true);
+        $mockDataMap->expects(self::any())->method('getColumnMap')->willReturn($mockColumnMap);
+        $mockDataMap->expects(self::any())->method('getTableName')->willReturn($tableName);
         $mockDataMapper = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class)
             ->setMethods(['getDataMap', 'getPlainValue'])
             ->disableOriginalConstructor()
             ->getMock();
         $mockDataMapper->expects(self::once())->method('getDataMap')
-            ->will(self::returnValue($mockDataMap));
+            ->willReturn($mockDataMap);
         $mockDataMapper->expects(self::once())->method('getPlainValue')
-            ->will(self::returnValue('plainPropertyValue'));
+            ->willReturn('plainPropertyValue');
         $expectedUid = 52;
 
         $expressionBuilderProphet = $this->prophesize(ExpressionBuilder::class);
@@ -122,7 +122,7 @@ class Typo3DbBackendTest extends UnitTestCase