Tests: Replaced setMethods as it is deprecated
This commit is contained in:
parent
109f112131
commit
867d720f15
|
@ -117,8 +117,8 @@ class EngelsystemLoggerTest extends ApplicationFeatureTest
|
||||||
LogEntry::query()->truncate();
|
LogEntry::query()->truncate();
|
||||||
$logger = $this->getLogger();
|
$logger = $this->getLogger();
|
||||||
|
|
||||||
$mock = $this->getMockBuilder('someDataProvider')
|
$mock = $this->getMockBuilder(stdClass::class)
|
||||||
->setMethods(['__toString'])
|
->addMethods(['__toString'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$mock->expects($this->atLeastOnce())
|
$mock->expects($this->atLeastOnce())
|
||||||
|
|
|
@ -113,7 +113,7 @@ class ApplicationTest extends TestCase
|
||||||
$mockClassName = $this->getMockClass(ServiceProvider::class);
|
$mockClassName = $this->getMockClass(ServiceProvider::class);
|
||||||
$serviceProvider = $this->getMockBuilder($mockClassName)
|
$serviceProvider = $this->getMockBuilder($mockClassName)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods(['register'])
|
->onlyMethods(['register'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$serviceProvider->expects($this->once())
|
$serviceProvider->expects($this->once())
|
||||||
|
@ -132,7 +132,7 @@ class ApplicationTest extends TestCase
|
||||||
{
|
{
|
||||||
/** @var Application|MockObject $app */
|
/** @var Application|MockObject $app */
|
||||||
$app = $this->getMockBuilder(Application::class)
|
$app = $this->getMockBuilder(Application::class)
|
||||||
->setMethods(['register'])
|
->onlyMethods(['register'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$serviceProvider = $this->mockServiceProvider($app, ['boot']);
|
$serviceProvider = $this->mockServiceProvider($app, ['boot']);
|
||||||
|
@ -175,7 +175,7 @@ class ApplicationTest extends TestCase
|
||||||
{
|
{
|
||||||
$serviceProvider = $this->getMockBuilder(ServiceProvider::class)
|
$serviceProvider = $this->getMockBuilder(ServiceProvider::class)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods($methods)
|
->onlyMethods($methods)
|
||||||
->getMockForAbstractClass();
|
->getMockForAbstractClass();
|
||||||
|
|
||||||
return $serviceProvider;
|
return $serviceProvider;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class MigrateTest extends TestCase
|
||||||
{
|
{
|
||||||
/** @var Application|MockObject $app */
|
/** @var Application|MockObject $app */
|
||||||
$app = $this->getMockBuilder(Application::class)
|
$app = $this->getMockBuilder(Application::class)
|
||||||
->setMethods(['instance'])
|
->onlyMethods(['instance'])
|
||||||
->getMock();
|
->getMock();
|
||||||
/** @var SchemaBuilder|MockObject $builder */
|
/** @var SchemaBuilder|MockObject $builder */
|
||||||
$builder = $this->getMockBuilder(SchemaBuilder::class)
|
$builder = $this->getMockBuilder(SchemaBuilder::class)
|
||||||
|
@ -33,7 +33,7 @@ class MigrateTest extends TestCase
|
||||||
/** @var Migrate|MockObject $migration */
|
/** @var Migrate|MockObject $migration */
|
||||||
$migration = $this->getMockBuilder(Migrate::class)
|
$migration = $this->getMockBuilder(Migrate::class)
|
||||||
->setConstructorArgs([$builder, $app])
|
->setConstructorArgs([$builder, $app])
|
||||||
->setMethods(['initMigration', 'getMigrationFiles', 'getMigrated', 'migrate', 'setMigrated'])
|
->onlyMethods(['initMigration', 'getMigrationFiles', 'getMigrated', 'migrate', 'setMigrated'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$migration->expects($this->atLeastOnce())
|
$migration->expects($this->atLeastOnce())
|
||||||
|
|
|
@ -33,7 +33,7 @@ class HandlerTest extends TestCase
|
||||||
{
|
{
|
||||||
/** @var Handler|MockObject $handler */
|
/** @var Handler|MockObject $handler */
|
||||||
$handler = $this->getMockBuilder(Handler::class)
|
$handler = $this->getMockBuilder(Handler::class)
|
||||||
->setMethods(['exceptionHandler'])
|
->onlyMethods(['exceptionHandler'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$handler->expects($this->once())
|
$handler->expects($this->once())
|
||||||
|
@ -65,7 +65,7 @@ class HandlerTest extends TestCase
|
||||||
|
|
||||||
/** @var Handler|MockObject $handler */
|
/** @var Handler|MockObject $handler */
|
||||||
$handler = $this->getMockBuilder(Handler::class)
|
$handler = $this->getMockBuilder(Handler::class)
|
||||||
->setMethods(['terminateApplicationImmediately'])
|
->onlyMethods(['terminateApplicationImmediately'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$handler->expects($this->once())
|
$handler->expects($this->once())
|
||||||
->method('terminateApplicationImmediately');
|
->method('terminateApplicationImmediately');
|
||||||
|
|
|
@ -128,7 +128,7 @@ class AuthenticatorTest extends ServiceProviderTest
|
||||||
/** @var Authenticator|MockObject $auth */
|
/** @var Authenticator|MockObject $auth */
|
||||||
$auth = $this->getMockBuilder(Authenticator::class)
|
$auth = $this->getMockBuilder(Authenticator::class)
|
||||||
->setConstructorArgs([$request, $session, $userRepository])
|
->setConstructorArgs([$request, $session, $userRepository])
|
||||||
->setMethods(['getPermissionsByGroup', 'getPermissionsByUser', 'user'])
|
->onlyMethods(['getPermissionsByGroup', 'getPermissionsByUser', 'user'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$auth->expects($this->exactly(1))
|
$auth->expects($this->exactly(1))
|
||||||
->method('getPermissionsByGroup')
|
->method('getPermissionsByGroup')
|
||||||
|
@ -203,7 +203,7 @@ class AuthenticatorTest extends ServiceProviderTest
|
||||||
/** @var Authenticator|MockObject $auth */
|
/** @var Authenticator|MockObject $auth */
|
||||||
$auth = $this->getMockBuilder(Authenticator::class)
|
$auth = $this->getMockBuilder(Authenticator::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->setMethods(['setPassword'])
|
->onlyMethods(['setPassword'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$auth->expects($this->once())
|
$auth->expects($this->once())
|
||||||
|
|
|
@ -26,7 +26,7 @@ class TranslatorTest extends ServiceProviderTest
|
||||||
|
|
||||||
/** @var callable|MockObject $localeChange */
|
/** @var callable|MockObject $localeChange */
|
||||||
$localeChange = $this->getMockBuilder(stdClass::class)
|
$localeChange = $this->getMockBuilder(stdClass::class)
|
||||||
->setMethods(['__invoke'])
|
->addMethods(['__invoke'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$localeChange->expects($this->exactly(2))
|
$localeChange->expects($this->exactly(2))
|
||||||
->method('__invoke')
|
->method('__invoke')
|
||||||
|
@ -56,7 +56,7 @@ class TranslatorTest extends ServiceProviderTest
|
||||||
/** @var Translator|MockObject $translator */
|
/** @var Translator|MockObject $translator */
|
||||||
$translator = $this->getMockBuilder(Translator::class)
|
$translator = $this->getMockBuilder(Translator::class)
|
||||||
->setConstructorArgs(['de_DE', 'en_US', function () { }, ['de_DE' => 'Deutsch']])
|
->setConstructorArgs(['de_DE', 'en_US', function () { }, ['de_DE' => 'Deutsch']])
|
||||||
->setMethods(['translateText'])
|
->onlyMethods(['translateText'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$translator->expects($this->exactly(2))
|
$translator->expects($this->exactly(2))
|
||||||
->method('translateText')
|
->method('translateText')
|
||||||
|
@ -78,7 +78,7 @@ class TranslatorTest extends ServiceProviderTest
|
||||||
/** @var Translator|MockObject $translator */
|
/** @var Translator|MockObject $translator */
|
||||||
$translator = $this->getMockBuilder(Translator::class)
|
$translator = $this->getMockBuilder(Translator::class)
|
||||||
->setConstructorArgs(['de_DE', 'en_US', function () { }, ['de_DE' => 'Deutsch']])
|
->setConstructorArgs(['de_DE', 'en_US', function () { }, ['de_DE' => 'Deutsch']])
|
||||||
->setMethods(['translateText'])
|
->onlyMethods(['translateText'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$translator->expects($this->once())
|
$translator->expects($this->once())
|
||||||
->method('translateText')
|
->method('translateText')
|
||||||
|
@ -100,7 +100,7 @@ class TranslatorTest extends ServiceProviderTest
|
||||||
$gtt = $this->createMock(GettextTranslator::class);
|
$gtt = $this->createMock(GettextTranslator::class);
|
||||||
/** @var callable|MockObject $getTranslator */
|
/** @var callable|MockObject $getTranslator */
|
||||||
$getTranslator = $this->getMockBuilder(stdClass::class)
|
$getTranslator = $this->getMockBuilder(stdClass::class)
|
||||||
->setMethods(['__invoke'])
|
->addMethods(['__invoke'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$getTranslator->expects($this->exactly(5))
|
$getTranslator->expects($this->exactly(5))
|
||||||
->method('__invoke')
|
->method('__invoke')
|
||||||
|
|
|
@ -59,7 +59,7 @@ class RequestServiceProviderTest extends ServiceProviderTest
|
||||||
/** @var ServiceProvider|MockObject $serviceProvider */
|
/** @var ServiceProvider|MockObject $serviceProvider */
|
||||||
$serviceProvider = $this->getMockBuilder(RequestServiceProvider::class)
|
$serviceProvider = $this->getMockBuilder(RequestServiceProvider::class)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods(['setTrustedProxies'])
|
->onlyMethods(['setTrustedProxies'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$serviceProvider->expects($this->once())
|
$serviceProvider->expects($this->once())
|
||||||
->method('setTrustedProxies')
|
->method('setTrustedProxies')
|
||||||
|
|
|
@ -93,7 +93,7 @@ class RequestTest extends TestCase
|
||||||
/** @var Request|MockObject $request */
|
/** @var Request|MockObject $request */
|
||||||
$request = $this
|
$request = $this
|
||||||
->getMockBuilder(Request::class)
|
->getMockBuilder(Request::class)
|
||||||
->setMethods(['getPathInfo'])
|
->onlyMethods(['getPathInfo'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$request
|
$request
|
||||||
|
@ -116,7 +116,7 @@ class RequestTest extends TestCase
|
||||||
/** @var Request|MockObject $request */
|
/** @var Request|MockObject $request */
|
||||||
$request = $this
|
$request = $this
|
||||||
->getMockBuilder(Request::class)
|
->getMockBuilder(Request::class)
|
||||||
->setMethods(['getUri'])
|
->onlyMethods(['getUri'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$request
|
$request
|
||||||
|
@ -139,7 +139,7 @@ class RequestTest extends TestCase
|
||||||
/** @var Request|MockObject $request */
|
/** @var Request|MockObject $request */
|
||||||
$request = $this
|
$request = $this
|
||||||
->getMockBuilder(Request::class)
|
->getMockBuilder(Request::class)
|
||||||
->setMethods(['getQueryString', 'path'])
|
->onlyMethods(['getQueryString', 'path'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$request->expects($this->exactly(2))
|
$request->expects($this->exactly(2))
|
||||||
|
|
|
@ -36,7 +36,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
|
||||||
/** @var SessionServiceProvider|MockObject $serviceProvider */
|
/** @var SessionServiceProvider|MockObject $serviceProvider */
|
||||||
$serviceProvider = $this->getMockBuilder(SessionServiceProvider::class)
|
$serviceProvider = $this->getMockBuilder(SessionServiceProvider::class)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods(['isCli'])
|
->onlyMethods(['isCli'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
/** @var Config|MockObject $config */
|
/** @var Config|MockObject $config */
|
||||||
|
@ -175,7 +175,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
|
||||||
$sessionStorage = $this->getMockForAbstractClass(StorageInterface::class);
|
$sessionStorage = $this->getMockForAbstractClass(StorageInterface::class);
|
||||||
return $this->getMockBuilder(Session::class)
|
return $this->getMockBuilder(Session::class)
|
||||||
->setConstructorArgs([$sessionStorage])
|
->setConstructorArgs([$sessionStorage])
|
||||||
->setMethods(['start', 'has', 'set'])
|
->onlyMethods(['start', 'has', 'set'])
|
||||||
->getMock();
|
->getMock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class SessionServiceProviderTest extends ServiceProviderTest
|
||||||
private function getRequestMock()
|
private function getRequestMock()
|
||||||
{
|
{
|
||||||
return $this->getMockBuilder(Request::class)
|
return $this->getMockBuilder(Request::class)
|
||||||
->setMethods(['setSession'])
|
->onlyMethods(['setSession'])
|
||||||
->getMock();
|
->getMock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LogTransportTest extends TestCase
|
||||||
/** @var LogTransport|MockObject $transport */
|
/** @var LogTransport|MockObject $transport */
|
||||||
$transport = $this->getMockBuilder(LogTransport::class)
|
$transport = $this->getMockBuilder(LogTransport::class)
|
||||||
->setConstructorArgs(['logger' => $logger])
|
->setConstructorArgs(['logger' => $logger])
|
||||||
->setMethods(['allRecipients'])
|
->onlyMethods(['allRecipients'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$transport->expects($this->exactly(2))
|
$transport->expects($this->exactly(2))
|
||||||
->method('allRecipients')
|
->method('allRecipients')
|
||||||
|
|
|
@ -79,7 +79,7 @@ class TransportTest extends TestCase
|
||||||
$message = $this->createMock(SimpleMessage::class);
|
$message = $this->createMock(SimpleMessage::class);
|
||||||
/** @var TransportImplementation|MockObject $transport */
|
/** @var TransportImplementation|MockObject $transport */
|
||||||
$transport = $this->getMockBuilder(TransportImplementation::class)
|
$transport = $this->getMockBuilder(TransportImplementation::class)
|
||||||
->setMethods(['allRecipients'])
|
->onlyMethods(['allRecipients'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$transport->expects($this->once())
|
$transport->expects($this->once())
|
||||||
->method('allRecipients')
|
->method('allRecipients')
|
||||||
|
|
|
@ -132,7 +132,7 @@ class CallableHandlerTest extends TestCase
|
||||||
$response = $this->createMock(Response::class);
|
$response = $this->createMock(Response::class);
|
||||||
/** @var callable|MockObject $callable */
|
/** @var callable|MockObject $callable */
|
||||||
$callable = $this->getMockBuilder(stdClass::class)
|
$callable = $this->getMockBuilder(stdClass::class)
|
||||||
->setMethods(['__invoke'])
|
->addMethods(['__invoke'])
|
||||||
->getMock();
|
->getMock();
|
||||||
return [$request, $response, $callable, $handler];
|
return [$request, $response, $callable, $handler];
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class DispatcherTest extends TestCase
|
||||||
|
|
||||||
/** @var Dispatcher|MockObject $dispatcher */
|
/** @var Dispatcher|MockObject $dispatcher */
|
||||||
$dispatcher = $this->getMockBuilder(Dispatcher::class)
|
$dispatcher = $this->getMockBuilder(Dispatcher::class)
|
||||||
->setMethods(['handle'])
|
->onlyMethods(['handle'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$dispatcher->expects($this->once())
|
$dispatcher->expects($this->once())
|
||||||
|
@ -158,7 +158,7 @@ class DispatcherTest extends TestCase
|
||||||
/** @var Dispatcher|MockObject $dispatcher */
|
/** @var Dispatcher|MockObject $dispatcher */
|
||||||
$dispatcher = $this->getMockBuilder(Dispatcher::class)
|
$dispatcher = $this->getMockBuilder(Dispatcher::class)
|
||||||
->setConstructorArgs([[MiddlewareInterface::class, MiddlewareInterface::class]])
|
->setConstructorArgs([[MiddlewareInterface::class, MiddlewareInterface::class]])
|
||||||
->setMethods(['resolveMiddleware'])
|
->onlyMethods(['resolveMiddleware'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$dispatcher->expects($this->exactly(2))
|
$dispatcher->expects($this->exactly(2))
|
||||||
|
|
|
@ -141,7 +141,7 @@ class ErrorHandlerTest extends TestCase
|
||||||
/** @var ErrorHandler|MockObject $errorHandler */
|
/** @var ErrorHandler|MockObject $errorHandler */
|
||||||
$errorHandler = $this->getMockBuilder(ErrorHandler::class)
|
$errorHandler = $this->getMockBuilder(ErrorHandler::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->setMethods(['createResponse'])
|
->onlyMethods(['createResponse'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$errorHandler->expects($this->once())
|
$errorHandler->expects($this->once())
|
||||||
|
|
|
@ -29,7 +29,7 @@ class LegacyMiddlewareTest extends TestCase
|
||||||
/** @var LegacyMiddleware|MockObject $middleware */
|
/** @var LegacyMiddleware|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(LegacyMiddleware::class)
|
$middleware = $this->getMockBuilder(LegacyMiddleware::class)
|
||||||
->setConstructorArgs([$container, $auth])
|
->setConstructorArgs([$container, $auth])
|
||||||
->setMethods(['loadPage', 'renderPage'])
|
->onlyMethods(['loadPage', 'renderPage'])
|
||||||
->getMock();
|
->getMock();
|
||||||
/** @var Request|MockObject $defaultRequest */
|
/** @var Request|MockObject $defaultRequest */
|
||||||
$defaultRequest = $this->createMock(Request::class);
|
$defaultRequest = $this->createMock(Request::class);
|
||||||
|
|
|
@ -58,7 +58,7 @@ class RequestHandlerTest extends TestCase
|
||||||
/** @var RequestHandler|MockObject $middleware */
|
/** @var RequestHandler|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(RequestHandler::class)
|
$middleware = $this->getMockBuilder(RequestHandler::class)
|
||||||
->setConstructorArgs([$container])
|
->setConstructorArgs([$container])
|
||||||
->setMethods(['resolveRequestHandler'])
|
->onlyMethods(['resolveRequestHandler'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$middleware->expects($this->exactly(3))
|
$middleware->expects($this->exactly(3))
|
||||||
->method('resolveRequestHandler')
|
->method('resolveRequestHandler')
|
||||||
|
@ -110,7 +110,7 @@ class RequestHandlerTest extends TestCase
|
||||||
/** @var RequestHandler|MockObject $middleware */
|
/** @var RequestHandler|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(RequestHandler::class)
|
$middleware = $this->getMockBuilder(RequestHandler::class)
|
||||||
->setConstructorArgs([$container])
|
->setConstructorArgs([$container])
|
||||||
->setMethods(['resolveMiddleware'])
|
->onlyMethods(['resolveMiddleware'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$middleware->expects($this->once())
|
$middleware->expects($this->once())
|
||||||
->method('resolveMiddleware')
|
->method('resolveMiddleware')
|
||||||
|
@ -174,7 +174,7 @@ class RequestHandlerTest extends TestCase
|
||||||
/** @var RequestHandler|MockObject $middleware */
|
/** @var RequestHandler|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(RequestHandler::class)
|
$middleware = $this->getMockBuilder(RequestHandler::class)
|
||||||
->setConstructorArgs([$container])
|
->setConstructorArgs([$container])
|
||||||
->setMethods(['resolveRequestHandler'])
|
->onlyMethods(['resolveRequestHandler'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$middleware->expects($this->exactly(2))
|
$middleware->expects($this->exactly(2))
|
||||||
|
|
|
@ -62,7 +62,7 @@ class RouteDispatcherServiceProviderTest extends ServiceProviderTest
|
||||||
/** @var RouteDispatcherServiceProvider|MockObject $serviceProvider */
|
/** @var RouteDispatcherServiceProvider|MockObject $serviceProvider */
|
||||||
$serviceProvider = $this->getMockBuilder(RouteDispatcherServiceProvider::class)
|
$serviceProvider = $this->getMockBuilder(RouteDispatcherServiceProvider::class)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods(['generateRouting'])
|
->onlyMethods(['generateRouting'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$serviceProvider->expects($this->once())
|
$serviceProvider->expects($this->once())
|
||||||
|
|
|
@ -18,7 +18,7 @@ class SendResponseHandlerTest extends TestCase
|
||||||
{
|
{
|
||||||
/** @var SendResponseHandler|MockObject $middleware */
|
/** @var SendResponseHandler|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(SendResponseHandler::class)
|
$middleware = $this->getMockBuilder(SendResponseHandler::class)
|
||||||
->setMethods(['headersSent', 'sendHeader'])
|
->onlyMethods(['headersSent', 'sendHeader'])
|
||||||
->getMock();
|
->getMock();
|
||||||
/** @var ServerRequestInterface|MockObject $request */
|
/** @var ServerRequestInterface|MockObject $request */
|
||||||
$request = $this->getMockForAbstractClass(ServerRequestInterface::class);
|
$request = $this->getMockForAbstractClass(ServerRequestInterface::class);
|
||||||
|
|
|
@ -48,7 +48,7 @@ class SessionHandlerTest extends TestCase
|
||||||
/** @var SessionHandler|MockObject $middleware */
|
/** @var SessionHandler|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(SessionHandler::class)
|
$middleware = $this->getMockBuilder(SessionHandler::class)
|
||||||
->setConstructorArgs([$sessionStorage, ['/foo']])
|
->setConstructorArgs([$sessionStorage, ['/foo']])
|
||||||
->setMethods(['destroyNative'])
|
->onlyMethods(['destroyNative'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$middleware->expects($this->once())
|
$middleware->expects($this->once())
|
||||||
|
|
|
@ -34,7 +34,7 @@ class VerifyCsrfTokenTest extends TestCase
|
||||||
/** @var VerifyCsrfToken|MockObject $middleware */
|
/** @var VerifyCsrfToken|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(VerifyCsrfToken::class)
|
$middleware = $this->getMockBuilder(VerifyCsrfToken::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->setMethods(['tokensMatch'])
|
->onlyMethods(['tokensMatch'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$middleware->expects($this->exactly(2))
|
$middleware->expects($this->exactly(2))
|
||||||
|
@ -74,7 +74,7 @@ class VerifyCsrfTokenTest extends TestCase
|
||||||
/** @var VerifyCsrfToken|MockObject $middleware */
|
/** @var VerifyCsrfToken|MockObject $middleware */
|
||||||
$middleware = $this->getMockBuilder(VerifyCsrfToken::class)
|
$middleware = $this->getMockBuilder(VerifyCsrfToken::class)
|
||||||
->setConstructorArgs([$session])
|
->setConstructorArgs([$session])
|
||||||
->setMethods(['isReading'])
|
->onlyMethods(['isReading'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$middleware->expects($this->atLeastOnce())
|
$middleware->expects($this->atLeastOnce())
|
||||||
|
|
|
@ -31,7 +31,7 @@ class CsrfTest extends ExtensionTest
|
||||||
/** @var Csrf|MockObject $extension */
|
/** @var Csrf|MockObject $extension */
|
||||||
$extension = $this->getMockBuilder(Csrf::class)
|
$extension = $this->getMockBuilder(Csrf::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->setMethods(['getCsrfToken'])
|
->onlyMethods(['getCsrfToken'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$extension->expects($this->once())
|
$extension->expects($this->once())
|
||||||
|
|
|
@ -48,7 +48,7 @@ class TwigServiceProviderTest extends ServiceProviderTest
|
||||||
/** @var TwigServiceProvider|MockObject $serviceProvider */
|
/** @var TwigServiceProvider|MockObject $serviceProvider */
|
||||||
$serviceProvider = $this->getMockBuilder(TwigServiceProvider::class)
|
$serviceProvider = $this->getMockBuilder(TwigServiceProvider::class)
|
||||||
->setConstructorArgs([$app])
|
->setConstructorArgs([$app])
|
||||||
->setMethods(['registerTwigEngine'])
|
->onlyMethods(['registerTwigEngine'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$serviceProvider->expects($this->once())
|
$serviceProvider->expects($this->once())
|
||||||
->method('registerTwigEngine');
|
->method('registerTwigEngine');
|
||||||
|
@ -103,7 +103,7 @@ class TwigServiceProviderTest extends ServiceProviderTest
|
||||||
$config = $this->createMock(Config::class);
|
$config = $this->createMock(Config::class);
|
||||||
/** @var TwigCore|MockObject $twigCore */
|
/** @var TwigCore|MockObject $twigCore */
|
||||||
$twigCore = $this->getMockBuilder(stdClass::class)
|
$twigCore = $this->getMockBuilder(stdClass::class)
|
||||||
->setMethods(['setTimezone'])
|
->addMethods(['setTimezone'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$app = $this->getApp(['make', 'instance', 'tag', 'get']);
|
$app = $this->getApp(['make', 'instance', 'tag', 'get']);
|
||||||
|
|
|
@ -14,7 +14,7 @@ abstract class ServiceProviderTest extends TestCase
|
||||||
protected function getApp($methods = ['make', 'instance'])
|
protected function getApp($methods = ['make', 'instance'])
|
||||||
{
|
{
|
||||||
return $this->getMockBuilder(Application::class)
|
return $this->getMockBuilder(Application::class)
|
||||||
->setMethods($methods)
|
->onlyMethods($methods)
|
||||||
->getMock();
|
->getMock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue