Completed
Push — master ( c114e4...0fa665 )
by Eric
9s
created

createTranslatorMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Bundle\ResourceBundle\Tests\DependencyInjection;
13
14
use Doctrine\ODM\MongoDB\DocumentManager;
15
use Hateoas\Representation\Factory\PagerfantaFactory;
16
use Lug\Bundle\GridBundle\Handler\GridHandlerInterface;
17
use Lug\Bundle\ResourceBundle\DependencyInjection\Configurator\ResolveTargetSubscriberConfigurator;
18
use Lug\Bundle\ResourceBundle\DependencyInjection\LugResourceExtension;
19
use Lug\Bundle\ResourceBundle\EventListener\FlashListener;
20
use Lug\Bundle\ResourceBundle\EventListener\MessageListener;
21
use Lug\Bundle\ResourceBundle\EventSubscriber\Doctrine\MongoDB\ResourceSubscriber as DoctrineMongoDBResourceSubscriber;
22
use Lug\Bundle\ResourceBundle\EventSubscriber\Doctrine\ORM\ResourceSubscriber as DoctrineORMResourceSubscriber;
23
use Lug\Bundle\ResourceBundle\EventSubscriber\RoutingSubscriber;
24
use Lug\Bundle\ResourceBundle\Form\EventSubscriber\CollectionSubscriber;
25
use Lug\Bundle\ResourceBundle\Form\EventSubscriber\FlashCsrfProtectionSubscriber;
26
use Lug\Bundle\ResourceBundle\Form\EventSubscriber\XmlHttpRequestSubscriber;
27
use Lug\Bundle\ResourceBundle\Form\Extension\CollectionExtension;
28
use Lug\Bundle\ResourceBundle\Form\Extension\DateExtension;
29
use Lug\Bundle\ResourceBundle\Form\Extension\DateTimeExtension;
30
use Lug\Bundle\ResourceBundle\Form\Extension\LabelButtonExtension;
31
use Lug\Bundle\ResourceBundle\Form\Extension\LabelFormExtension;
32
use Lug\Bundle\ResourceBundle\Form\Extension\TimeExtension;
33
use Lug\Bundle\ResourceBundle\Form\Extension\XmlHttpRequestExtension;
34
use Lug\Bundle\ResourceBundle\Form\FormFactory;
35
use Lug\Bundle\ResourceBundle\Form\Type\CsrfProtectionType;
36
use Lug\Bundle\ResourceBundle\Rest\Action\EventSubscriber\ApiActionSubscriber;
37
use Lug\Bundle\ResourceBundle\Rest\Action\EventSubscriber\ViewActionSubscriber;
38
use Lug\Bundle\ResourceBundle\Rest\View\EventSubscriber\FormViewSubscriber;
39
use Lug\Bundle\ResourceBundle\Rest\View\EventSubscriber\GridViewSubscriber;
40
use Lug\Bundle\ResourceBundle\Rest\View\EventSubscriber\PagerfantaViewSubscriber;
41
use Lug\Bundle\ResourceBundle\Rest\View\EventSubscriber\ResourceViewSubscriber;
42
use Lug\Bundle\ResourceBundle\Routing\CachedParameterResolver;
43
use Lug\Bundle\ResourceBundle\Routing\ParameterResolver;
44
use Lug\Bundle\ResourceBundle\Security\SecurityChecker;
45
use Lug\Component\Resource\Form\Type\Doctrine\MongoDB\ResourceChoiceType as DoctrineMongoDBResourceChoiceType;
46
use Lug\Component\Resource\Form\Type\Doctrine\ORM\ResourceChoiceType as DoctrineORMResourceChoiceType;
47
use Lug\Component\Resource\Form\Type\ResourceType;
48
use Lug\Component\Resource\Registry\DomainManagerRegistry;
49
use Lug\Component\Resource\Registry\FactoryRegistry;
50
use Lug\Component\Resource\Registry\ManagerRegistry;
51
use Lug\Component\Resource\Registry\RepositoryRegistry;
52
use Lug\Component\Resource\Registry\ResourceRegistry;
53
use Lug\Component\Resource\Repository\Doctrine\MongoDB\RepositoryFactory as DoctrineMongoDBRepositoryFactory;
54
use Lug\Component\Resource\Repository\Doctrine\ORM\RepositoryFactory as DoctrineORMRepositoryFactory;
55
use Symfony\Bridge\Doctrine\RegistryInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;
57
use Symfony\Component\Form\FormFactoryInterface;
58
use Symfony\Component\Form\FormRendererInterface;
59
use Symfony\Component\HttpFoundation\RequestStack;
60
use Symfony\Component\HttpFoundation\Session\Session;
61
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
62
use Symfony\Component\Routing\RouterInterface;
63
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
64
use Symfony\Component\Translation\TranslatorInterface;
65
66
/**
67
 * @author GeLo <[email protected]>
68
 */
69
abstract class AbstractLugResourceExtensionTest extends \PHPUnit_Framework_TestCase
70
{
71
    /**
72
     * @var LugResourceExtension
73
     */
74
    private $extension;
75
76
    /**
77
     * @var ContainerBuilder
78
     */
79
    private $container;
80
81
    /**
82
     * @var \PHPUnit_Framework_MockObject_MockObject|AuthorizationCheckerInterface
83
     */
84
    private $authorizationChecker;
85
86
    /**
87
     * @var \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface
88
     */
89
    private $translator;
90
91
    /**
92
     * @var \PHPUnit_Framework_MockObject_MockObject|PropertyAccessorInterface
93
     */
94
    private $propertyAccessor;
95
96
    /**
97
     * @var \PHPUnit_Framework_MockObject_MockObject|Session
98
     */
99
    private $session;
100
101
    /**
102
     * @var \PHPUnit_Framework_MockObject_MockObject|FormFactoryInterface
103
     */
104
    private $formFactory;
105
106
    /**
107
     * @var \PHPUnit_Framework_MockObject_MockObject|FormRendererInterface
108
     */
109
    private $formRenderer;
110
111
    /**
112
     * @var \PHPUnit_Framework_MockObject_MockObject|RegistryInterface
113
     */
114
    private $registry;
115
116
    /**
117
     * @var \PHPUnit_Framework_MockObject_MockObject|RouterInterface
118
     */
119
    private $router;
120
121
    /**
122
     * @var \PHPUnit_Framework_MockObject_MockObject|RequestStack
123
     */
124
    private $requestStack;
125
126
    /**
127
     * @var \PHPUnit_Framework_MockObject_MockObject|GridHandlerInterface
128
     */
129
    private $gridHandler;
130
131
    /**
132
     * {@inheritdoc}
133
     */
134
    protected function setUp()
135
    {
136
        $this->authorizationChecker = $this->createAuthorizationCheckerMock();
137
        $this->translator = $this->createTranslatorMock();
138
        $this->propertyAccessor = $this->createPropertyAccessorMock();
139
        $this->session = $this->createSessionMock();
140
        $this->formFactory = $this->createFormFactoryMock();
141
        $this->formRenderer = $this->createFormRendererMock();
142
        $this->registry = $this->createRegistryMock();
143
        $this->router = $this->createRouterMock();
144
        $this->requestStack = $this->createRequestStackMock();
145
        $this->gridHandler = $this->createGridHandler();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->createGridHandler() can also be of type object<Lug\Bundle\GridBu...r\GridHandlerInterface>. However, the property $gridHandler is declared as type object<PHPUnit_Framework_MockObject_MockObject>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
146
147
        $this->extension = new LugResourceExtension();
148
        $this->container = new ContainerBuilder();
149
150
        $this->container->set('security.authorization_checker', $this->authorizationChecker);
151
        $this->container->set('translator', $this->translator);
152
        $this->container->set('property_accessor', $this->propertyAccessor);
153
        $this->container->set('session', $this->session);
154
        $this->container->set('form.factory', $this->formFactory);
155
        $this->container->set('twig.form.renderer', $this->formRenderer);
156
        $this->container->set('doctrine', $this->registry);
157
        $this->container->set('router', $this->router);
158
        $this->container->set('request_stack', $this->requestStack);
159
        $this->container->set('lug.grid.handler', $this->gridHandler);
160
161
        $this->container->registerExtension($this->extension);
162
        $this->container->loadFromExtension($this->extension->getAlias());
163
    }
164
165
    public function testConfigurator()
166
    {
167
        $this->compileContainer();
168
169
        $this->assertInstanceOf(
170
            ResolveTargetSubscriberConfigurator::class,
171
            $this->container->get('lug.resource.configurator.resolve_target_entity')
172
        );
173
    }
174
175
    public function testEventListener()
176
    {
177
        $this->compileContainer();
178
179
        $this->assertInstanceOf(FlashListener::class, $this->container->get('lug.resource.listener.flash'));
180
        $this->assertInstanceOf(MessageListener::class, $this->container->get('lug.resource.listener.message'));
181
    }
182
183
    public function testEventSubscriber()
184
    {
185
        $this->compileContainer();
186
187
        $this->assertInstanceOf(
188
            DoctrineORMResourceSubscriber::class,
189
            $this->container->get('lug.resource.subscriber.doctrine.orm')
190
        );
191
192
        if (class_exists(DocumentManager::class)) {
193
            $this->assertInstanceOf(
194
                DoctrineMongoDBResourceSubscriber::class,
195
                $this->container->get('lug.resource.subscriber.doctrine.mongodb')
196
            );
197
        }
198
199
        $this->assertInstanceOf(RoutingSubscriber::class, $this->container->get('lug.resource.subscriber.routing'));
200
    }
201
202
    public function testForm()
203
    {
204
        $this->compileContainer();
205
206
        $this->assertInstanceOf(FormFactory::class, $this->container->get('lug.resource.form.factory'));
207
208
        $resourceType = 'lug.resource.form.type.resource';
209
        $this->assertTrue($this->container->getDefinition($resourceType)->hasTag('form.type'));
210
        $this->assertInstanceOf(ResourceType::class, $this->container->get($resourceType));
211
212
        $doctrineOrmResourceChoiceType = 'lug.resource.form.type.doctrine.orm.resource.choice';
213
        $this->assertTrue($this->container->getDefinition($doctrineOrmResourceChoiceType)->hasTag('form.type'));
214
215
        $this->assertInstanceOf(
216
            DoctrineORMResourceChoiceType::class,
217
            $this->container->get($doctrineOrmResourceChoiceType)
218
        );
219
220
        if (class_exists(DocumentManager::class)) {
221
            $doctrineMongoDbResourceChoiceType = 'lug.resource.form.type.doctrine.mongodb.resource.choice';
222
            $this->assertTrue($this->container->getDefinition($doctrineMongoDbResourceChoiceType)->hasTag('form.type'));
223
224
            $this->assertInstanceOf(
225
                DoctrineMongoDBResourceChoiceType::class,
226
                $this->container->get($doctrineMongoDbResourceChoiceType)
227
            );
228
        }
229
230
        $flashCsrfProtectionSubscriber = 'lug.resource.form.subscriber.flash_csrf_protection';
231
232
        $this->assertInstanceOf(
233
            FlashCsrfProtectionSubscriber::class,
234
            $this->container->get($flashCsrfProtectionSubscriber)
235
        );
236
237
        $csrfProtectionType = 'lug.resource.form.type.csrf_protection';
238
        $this->assertTrue($this->container->getDefinition($csrfProtectionType)->hasTag('form.type'));
239
        $this->assertInstanceOf(CsrfProtectionType::class, $this->container->get($csrfProtectionType));
240
241
        $collectionSubscriber = 'lug.resource.form.subscriber.collection';
242
        $this->assertInstanceOf(CollectionSubscriber::class, $this->container->get($collectionSubscriber));
243
244
        $collectionExtension = 'lug.resource.form.extension.collection';
245
        $this->assertTrue($this->container->getDefinition($collectionExtension)->hasTag('form.type_extension'));
246
        $this->assertInstanceOf(CollectionExtension::class, $this->container->get($collectionExtension));
247
248
        $labelFormExtension = 'lug.resource.form.extension.label_form';
249
        $this->assertTrue($this->container->getDefinition($labelFormExtension)->hasTag('form.type_extension'));
250
        $this->assertInstanceOf(LabelFormExtension::class, $this->container->get($labelFormExtension));
251
252
        $buttonFormExtension = 'lug.resource.form.extension.label_button';
253
        $this->assertTrue($this->container->getDefinition($buttonFormExtension)->hasTag('form.type_extension'));
254
        $this->assertInstanceOf(LabelButtonExtension::class, $this->container->get($buttonFormExtension));
255
256
        $datetimeExtension = 'lug.resource.form.extension.datetime';
257
        $this->assertTrue($this->container->getDefinition($datetimeExtension)->hasTag('form.type_extension'));
258
        $this->assertInstanceOf(DateTimeExtension::class, $this->container->get($datetimeExtension));
259
260
        $dateExtension = 'lug.resource.form.extension.date';
261
        $this->assertTrue($this->container->getDefinition($dateExtension)->hasTag('form.type_extension'));
262
        $this->assertInstanceOf(DateExtension::class, $this->container->get($dateExtension));
263
264
        $timeExtension = 'lug.resource.form.extension.time';
265
        $this->assertTrue($this->container->getDefinition($timeExtension)->hasTag('form.type_extension'));
266
        $this->assertInstanceOf(TimeExtension::class, $this->container->get($timeExtension));
267
268
        $xmlHttpRequestSubscriber = 'lug.resource.form.subscriber.xml_http_request';
269
        $this->assertInstanceOf(XmlHttpRequestSubscriber::class, $this->container->get($xmlHttpRequestSubscriber));
270
271
        $xmlHttpRequestExtension = 'lug.resource.form.extension.xml_http_request';
272
        $this->assertTrue($this->container->getDefinition($xmlHttpRequestExtension)->hasTag('form.type_extension'));
273
        $this->assertInstanceOf(XmlHttpRequestExtension::class, $this->container->get($xmlHttpRequestExtension));
274
    }
275
276
    public function testHateoas()
277
    {
278
        $this->compileContainer();
279
280
        $this->assertInstanceOf(
281
            PagerfantaFactory::class,
282
            $this->container->get('lug.resource.hateoas.pagerfanta_representation')
283
        );
284
    }
285
286
    public function testRegistry()
287
    {
288
        $this->compileContainer();
289
290
        $resourceRegistry = 'lug.resource.registry';
291
        $this->assertTrue($this->container->getDefinition($resourceRegistry)->hasTag('lug.registry'));
292
        $this->assertInstanceOf(ResourceRegistry::class, $this->container->get($resourceRegistry));
293
294
        $factoryRegistry = 'lug.resource.registry.factory';
295
        $this->assertTrue($this->container->getDefinition($factoryRegistry)->hasTag('lug.registry'));
296
        $this->assertInstanceOf(FactoryRegistry::class, $this->container->get($factoryRegistry));
297
298
        $managerRegistry = 'lug.resource.registry.manager';
299
        $this->assertTrue($this->container->getDefinition($managerRegistry)->hasTag('lug.registry'));
300
        $this->assertInstanceOf(ManagerRegistry::class, $this->container->get($managerRegistry));
301
302
        $repositoryRegistry = 'lug.resource.registry.repository';
303
        $this->assertTrue($this->container->getDefinition($repositoryRegistry)->hasTag('lug.registry'));
304
        $this->assertInstanceOf(RepositoryRegistry::class, $this->container->get($repositoryRegistry));
305
306
        $domainManagerRegistry = 'lug.resource.registry.domain_manager';
307
        $this->assertTrue($this->container->getDefinition($domainManagerRegistry)->hasTag('lug.registry'));
308
        $this->assertInstanceOf(DomainManagerRegistry::class, $this->container->get($domainManagerRegistry));
309
    }
310
311 View Code Duplication
    public function testRepository()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
312
    {
313
        $this->compileContainer();
314
315
        $this->assertInstanceOf(
316
            DoctrineORMRepositoryFactory::class,
317
            $this->container->get('lug.resource.repository.doctrine.orm.factory')
318
        );
319
320
        if (class_exists(DocumentManager::class)) {
321
            $this->assertInstanceOf(
322
                DoctrineMongoDBRepositoryFactory::class,
323
                $this->container->get('lug.resource.repository.doctrine.mongodb.factory')
324
            );
325
        }
326
    }
327
328
    public function testRest()
329
    {
330
        $this->compileContainer();
331
332
        $viewActionSubscriber = 'lug.resource.rest.action.subscriber.view';
333
        $this->assertTrue($this->container->getDefinition($viewActionSubscriber)->hasTag('kernel.event_subscriber'));
334
        $this->assertInstanceOf(ViewActionSubscriber::class, $this->container->get($viewActionSubscriber));
335
336
        $apiActionSubscriber = 'lug.resource.rest.action.subscriber.api';
337
        $this->assertTrue($this->container->getDefinition($apiActionSubscriber)->hasTag('kernel.event_subscriber'));
338
        $this->assertInstanceOf(ApiActionSubscriber::class, $this->container->get($apiActionSubscriber));
339
340
        $formViewSubscriber = 'lug.resource.rest.view.subscriber.form';
341
        $this->assertTrue($this->container->getDefinition($formViewSubscriber)->hasTag('kernel.event_subscriber'));
342
        $this->assertInstanceOf(FormViewSubscriber::class, $this->container->get($formViewSubscriber));
343
344
        $gridViewSubscriber = 'lug.resource.rest.view.subscriber.grid';
345
        $this->assertTrue($this->container->getDefinition($gridViewSubscriber)->hasTag('kernel.event_subscriber'));
346
        $this->assertInstanceOf(GridViewSubscriber::class, $this->container->get($gridViewSubscriber));
347
348
        $pagerfantaViewSubscriber = 'lug.resource.rest.view.subscriber.pagerfanta';
349
350
        $this->assertTrue(
351
            $this->container->getDefinition($pagerfantaViewSubscriber)->hasTag('kernel.event_subscriber')
352
        );
353
354
        $this->assertInstanceOf(PagerfantaViewSubscriber::class, $this->container->get($pagerfantaViewSubscriber));
355
356
        $resourceViewSubscriber = 'lug.resource.rest.view.subscriber.resource';
357
        $this->assertTrue($this->container->getDefinition($resourceViewSubscriber)->hasTag('kernel.event_subscriber'));
358
        $this->assertInstanceOf(ResourceViewSubscriber::class, $this->container->get($resourceViewSubscriber));
359
    }
360
361
    public function testRouting()
362
    {
363
        $this->compileContainer();
364
365
        $this->assertInstanceOf(
366
            ParameterResolver::class,
367
            $this->container->get('lug.resource.routing.parameter_resolver.internal')
368
        );
369
370
        $this->assertInstanceOf(
371
            CachedParameterResolver::class,
372
            $this->container->get('lug.resource.routing.parameter_resolver')
373
        );
374
    }
375
376
    public function testSecurity()
377
    {
378
        $this->compileContainer();
379
380
        $this->assertInstanceOf(SecurityChecker::class, $this->container->get('lug.resource.security.checker'));
381
    }
382
383
    /**
384
     * @param ContainerBuilder $container
385
     * @param string           $configuration
386
     */
387
    abstract protected function loadConfiguration(ContainerBuilder $container, $configuration);
388
389
    /**
390
     * @param string|null $configuration
391
     */
392
    private function compileContainer($configuration = null)
393
    {
394
        if ($configuration !== null) {
395
            $this->loadConfiguration($this->container, $configuration);
396
        }
397
398
        $this->container->compile();
399
    }
400
401
    /**
402
     * @return \PHPUnit_Framework_MockObject_MockObject|AuthorizationCheckerInterface
403
     */
404
    private function createAuthorizationCheckerMock()
405
    {
406
        return $this->getMock(AuthorizationCheckerInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
407
    }
408
409
    /**
410
     * @return \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface
411
     */
412
    private function createTranslatorMock()
413
    {
414
        return $this->getMock(TranslatorInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
415
    }
416
417
    /**
418
     * @return \PHPUnit_Framework_MockObject_MockObject|PropertyAccessorInterface
419
     */
420
    private function createPropertyAccessorMock()
421
    {
422
        return $this->getMock(PropertyAccessorInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
423
    }
424
425
    /**
426
     * @return \PHPUnit_Framework_MockObject_MockObject|Session
427
     */
428
    private function createSessionMock()
429
    {
430
        return $this->getMock(Session::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
431
    }
432
433
    /**
434
     * @return \PHPUnit_Framework_MockObject_MockObject|FormFactoryInterface
435
     */
436
    private function createFormFactoryMock()
437
    {
438
        return $this->getMock(FormFactoryInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
439
    }
440
441
    /**
442
     * @return \PHPUnit_Framework_MockObject_MockObject|FormRendererInterface
443
     */
444
    private function createFormRendererMock()
445
    {
446
        return $this->getMock(FormRendererInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
447
    }
448
449
    /**
450
     * @return \PHPUnit_Framework_MockObject_MockObject|RegistryInterface
451
     */
452
    private function createRegistryMock()
453
    {
454
        return $this->getMock(RegistryInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
455
    }
456
457
    /**
458
     * @return \PHPUnit_Framework_MockObject_MockObject|RouterInterface
459
     */
460
    private function createRouterMock()
461
    {
462
        return $this->getMock(RouterInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
463
    }
464
465
    /**
466
     * @return \PHPUnit_Framework_MockObject_MockObject|RequestStack
467
     */
468
    private function createRequestStackMock()
469
    {
470
        return $this->getMock(RequestStack::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
471
    }
472
473
    /**
474
     * @return \PHPUnit_Framework_MockObject_MockObject|GridHandlerInterface
475
     */
476
    private function createGridHandler()
477
    {
478
        return $this->getMock(GridHandlerInterface::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::getMock() has been deprecated with message: Method deprecated since Release 5.4.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
479
    }
480
}
481