Completed
Pull Request — master (#40)
by Eric
13:22 queued 11s
created

createFormRendererMock()   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\EventDispatcher\ContainerAwareEventDispatcher;
58
use Symfony\Component\Form\FormFactoryInterface;
59
use Symfony\Component\Form\FormRendererInterface;
60
use Symfony\Component\HttpFoundation\RequestStack;
61
use Symfony\Component\HttpFoundation\Session\Session;
62
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
63
use Symfony\Component\Routing\RouterInterface;
64
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
65
use Symfony\Component\Translation\TranslatorInterface;
66
67
/**
68
 * @author GeLo <[email protected]>
69
 */
70
abstract class AbstractLugResourceExtensionTest extends \PHPUnit_Framework_TestCase
71
{
72
    /**
73
     * @var LugResourceExtension
74
     */
75
    private $extension;
76
77
    /**
78
     * @var ContainerBuilder
79
     */
80
    private $container;
81
82
    /**
83
     * @var \PHPUnit_Framework_MockObject_MockObject|AuthorizationCheckerInterface
84
     */
85
    private $authorizationChecker;
86
87
    /**
88
     * @var \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface
89
     */
90
    private $translator;
91
92
    /**
93
     * @var \PHPUnit_Framework_MockObject_MockObject|PropertyAccessorInterface
94
     */
95
    private $propertyAccessor;
96
97
    /**
98
     * @var \PHPUnit_Framework_MockObject_MockObject|Session
99
     */
100
    private $session;
101
102
    /**
103
     * @var \PHPUnit_Framework_MockObject_MockObject|FormFactoryInterface
104
     */
105
    private $formFactory;
106
107
    /**
108
     * @var \PHPUnit_Framework_MockObject_MockObject|FormRendererInterface
109
     */
110
    private $formRenderer;
111
112
    /**
113
     * @var \PHPUnit_Framework_MockObject_MockObject|RegistryInterface
114
     */
115
    private $registry;
116
117
    /**
118
     * @var \PHPUnit_Framework_MockObject_MockObject|RouterInterface
119
     */
120
    private $router;
121
122
    /**
123
     * @var \PHPUnit_Framework_MockObject_MockObject|RequestStack
124
     */
125
    private $requestStack;
126
127
    /**
128
     * @var \PHPUnit_Framework_MockObject_MockObject|GridHandlerInterface
129
     */
130
    private $gridHandler;
131
132
    /**
133
     * {@inheritdoc}
134
     */
135
    protected function setUp()
136
    {
137
        $this->authorizationChecker = $this->createAuthorizationCheckerMock();
138
        $this->translator = $this->createTranslatorMock();
139
        $this->propertyAccessor = $this->createPropertyAccessorMock();
140
        $this->session = $this->createSessionMock();
141
        $this->formFactory = $this->createFormFactoryMock();
142
        $this->formRenderer = $this->createFormRendererMock();
143
        $this->registry = $this->createRegistryMock();
144
        $this->router = $this->createRouterMock();
145
        $this->requestStack = $this->createRequestStackMock();
146
        $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...
147
148
        $this->extension = new LugResourceExtension();
149
        $this->container = new ContainerBuilder();
150
151
        $this->container->set('security.authorization_checker', $this->authorizationChecker);
152
        $this->container->set('translator', $this->translator);
153
        $this->container->set('property_accessor', $this->propertyAccessor);
154
        $this->container->set('session', $this->session);
155
        $this->container->set('form.factory', $this->formFactory);
156
        $this->container->set('twig.form.renderer', $this->formRenderer);
157
        $this->container->set('doctrine', $this->registry);
158
        $this->container->set('router', $this->router);
159
        $this->container->set('request_stack', $this->requestStack);
160
        $this->container->set('lug.grid.handler', $this->gridHandler);
161
162
        $this->container->registerExtension($this->extension);
163
        $this->container->loadFromExtension($this->extension->getAlias());
164
    }
165
166
    public function testConfigurator()
167
    {
168
        $this->compileContainer();
169
170
        $this->assertInstanceOf(
171
            ResolveTargetSubscriberConfigurator::class,
172
            $this->container->get('lug.resource.configurator.resolve_target_entity')
173
        );
174
    }
175
176
    public function testDomain()
177
    {
178
        $this->compileContainer();
179
180
        $this->assertInstanceOf(
181
            ContainerAwareEventDispatcher::class,
182
            $this->container->get('lug.resource.domain.event_dispatcher')
183
        );
184
    }
185
186
    public function testEventListener()
187
    {
188
        $this->compileContainer();
189
190
        $this->assertInstanceOf(FlashListener::class, $this->container->get('lug.resource.listener.flash'));
191
        $this->assertInstanceOf(MessageListener::class, $this->container->get('lug.resource.listener.message'));
192
    }
193
194
    public function testEventSubscriber()
195
    {
196
        $this->compileContainer();
197
198
        $this->assertInstanceOf(
199
            DoctrineORMResourceSubscriber::class,
200
            $this->container->get('lug.resource.subscriber.doctrine.orm')
201
        );
202
203
        if (class_exists(DocumentManager::class)) {
204
            $this->assertInstanceOf(
205
                DoctrineMongoDBResourceSubscriber::class,
206
                $this->container->get('lug.resource.subscriber.doctrine.mongodb')
207
            );
208
        }
209
210
        $this->assertInstanceOf(RoutingSubscriber::class, $this->container->get('lug.resource.subscriber.routing'));
211
    }
212
213
    public function testForm()
214
    {
215
        $this->compileContainer();
216
217
        $this->assertInstanceOf(FormFactory::class, $this->container->get('lug.resource.form.factory'));
218
219
        $resourceType = 'lug.resource.form.type.resource';
220
        $this->assertTrue($this->container->getDefinition($resourceType)->hasTag('form.type'));
221
        $this->assertInstanceOf(ResourceType::class, $this->container->get($resourceType));
222
223
        $doctrineOrmResourceChoiceType = 'lug.resource.form.type.doctrine.orm.resource.choice';
224
        $this->assertTrue($this->container->getDefinition($doctrineOrmResourceChoiceType)->hasTag('form.type'));
225
226
        $this->assertInstanceOf(
227
            DoctrineORMResourceChoiceType::class,
228
            $this->container->get($doctrineOrmResourceChoiceType)
229
        );
230
231
        if (class_exists(DocumentManager::class)) {
232
            $doctrineMongoDbResourceChoiceType = 'lug.resource.form.type.doctrine.mongodb.resource.choice';
233
            $this->assertTrue($this->container->getDefinition($doctrineMongoDbResourceChoiceType)->hasTag('form.type'));
234
235
            $this->assertInstanceOf(
236
                DoctrineMongoDBResourceChoiceType::class,
237
                $this->container->get($doctrineMongoDbResourceChoiceType)
238
            );
239
        }
240
241
        $flashCsrfProtectionSubscriber = 'lug.resource.form.subscriber.flash_csrf_protection';
242
243
        $this->assertInstanceOf(
244
            FlashCsrfProtectionSubscriber::class,
245
            $this->container->get($flashCsrfProtectionSubscriber)
246
        );
247
248
        $csrfProtectionType = 'lug.resource.form.type.csrf_protection';
249
        $this->assertTrue($this->container->getDefinition($csrfProtectionType)->hasTag('form.type'));
250
        $this->assertInstanceOf(CsrfProtectionType::class, $this->container->get($csrfProtectionType));
251
252
        $collectionSubscriber = 'lug.resource.form.subscriber.collection';
253
        $this->assertInstanceOf(CollectionSubscriber::class, $this->container->get($collectionSubscriber));
254
255
        $collectionExtension = 'lug.resource.form.extension.collection';
256
        $this->assertTrue($this->container->getDefinition($collectionExtension)->hasTag('form.type_extension'));
257
        $this->assertInstanceOf(CollectionExtension::class, $this->container->get($collectionExtension));
258
259
        $labelFormExtension = 'lug.resource.form.extension.label_form';
260
        $this->assertTrue($this->container->getDefinition($labelFormExtension)->hasTag('form.type_extension'));
261
        $this->assertInstanceOf(LabelFormExtension::class, $this->container->get($labelFormExtension));
262
263
        $buttonFormExtension = 'lug.resource.form.extension.label_button';
264
        $this->assertTrue($this->container->getDefinition($buttonFormExtension)->hasTag('form.type_extension'));
265
        $this->assertInstanceOf(LabelButtonExtension::class, $this->container->get($buttonFormExtension));
266
267
        $datetimeExtension = 'lug.resource.form.extension.datetime';
268
        $this->assertTrue($this->container->getDefinition($datetimeExtension)->hasTag('form.type_extension'));
269
        $this->assertInstanceOf(DateTimeExtension::class, $this->container->get($datetimeExtension));
270
271
        $dateExtension = 'lug.resource.form.extension.date';
272
        $this->assertTrue($this->container->getDefinition($dateExtension)->hasTag('form.type_extension'));
273
        $this->assertInstanceOf(DateExtension::class, $this->container->get($dateExtension));
274
275
        $timeExtension = 'lug.resource.form.extension.time';
276
        $this->assertTrue($this->container->getDefinition($timeExtension)->hasTag('form.type_extension'));
277
        $this->assertInstanceOf(TimeExtension::class, $this->container->get($timeExtension));
278
279
        $xmlHttpRequestSubscriber = 'lug.resource.form.subscriber.xml_http_request';
280
        $this->assertInstanceOf(XmlHttpRequestSubscriber::class, $this->container->get($xmlHttpRequestSubscriber));
281
282
        $xmlHttpRequestExtension = 'lug.resource.form.extension.xml_http_request';
283
        $this->assertTrue($this->container->getDefinition($xmlHttpRequestExtension)->hasTag('form.type_extension'));
284
        $this->assertInstanceOf(XmlHttpRequestExtension::class, $this->container->get($xmlHttpRequestExtension));
285
    }
286
287
    public function testHateoas()
288
    {
289
        $this->compileContainer();
290
291
        $this->assertInstanceOf(
292
            PagerfantaFactory::class,
293
            $this->container->get('lug.resource.hateoas.pagerfanta_representation')
294
        );
295
    }
296
297
    public function testRegistry()
298
    {
299
        $this->compileContainer();
300
301
        $resourceRegistry = 'lug.resource.registry';
302
        $this->assertTrue($this->container->getDefinition($resourceRegistry)->hasTag('lug.registry'));
303
        $this->assertInstanceOf(ResourceRegistry::class, $this->container->get($resourceRegistry));
304
305
        $factoryRegistry = 'lug.resource.registry.factory';
306
        $this->assertTrue($this->container->getDefinition($factoryRegistry)->hasTag('lug.registry'));
307
        $this->assertInstanceOf(FactoryRegistry::class, $this->container->get($factoryRegistry));
308
309
        $managerRegistry = 'lug.resource.registry.manager';
310
        $this->assertTrue($this->container->getDefinition($managerRegistry)->hasTag('lug.registry'));
311
        $this->assertInstanceOf(ManagerRegistry::class, $this->container->get($managerRegistry));
312
313
        $repositoryRegistry = 'lug.resource.registry.repository';
314
        $this->assertTrue($this->container->getDefinition($repositoryRegistry)->hasTag('lug.registry'));
315
        $this->assertInstanceOf(RepositoryRegistry::class, $this->container->get($repositoryRegistry));
316
317
        $domainManagerRegistry = 'lug.resource.registry.domain_manager';
318
        $this->assertTrue($this->container->getDefinition($domainManagerRegistry)->hasTag('lug.registry'));
319
        $this->assertInstanceOf(DomainManagerRegistry::class, $this->container->get($domainManagerRegistry));
320
    }
321
322 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...
323
    {
324
        $this->compileContainer();
325
326
        $this->assertInstanceOf(
327
            DoctrineORMRepositoryFactory::class,
328
            $this->container->get('lug.resource.repository.doctrine.orm.factory')
329
        );
330
331
        if (class_exists(DocumentManager::class)) {
332
            $this->assertInstanceOf(
333
                DoctrineMongoDBRepositoryFactory::class,
334
                $this->container->get('lug.resource.repository.doctrine.mongodb.factory')
335
            );
336
        }
337
    }
338
339
    public function testRest()
340
    {
341
        $this->compileContainer();
342
343
        $this->assertInstanceOf(
344
            ContainerAwareEventDispatcher::class,
345
            $this->container->get('lug.resource.rest.event_dispatcher')
346
        );
347
348
        $tag = 'lug.resource.rest.event_subscriber';
349
350
        $viewActionSubscriber = 'lug.resource.rest.action.subscriber.view';
351
        $this->assertTrue($this->container->getDefinition($viewActionSubscriber)->hasTag($tag));
352
        $this->assertInstanceOf(ViewActionSubscriber::class, $this->container->get($viewActionSubscriber));
353
354
        $apiActionSubscriber = 'lug.resource.rest.action.subscriber.api';
355
        $this->assertTrue($this->container->getDefinition($apiActionSubscriber)->hasTag($tag));
356
        $this->assertInstanceOf(ApiActionSubscriber::class, $this->container->get($apiActionSubscriber));
357
358
        $formViewSubscriber = 'lug.resource.rest.view.subscriber.form';
359
        $this->assertTrue($this->container->getDefinition($formViewSubscriber)->hasTag($tag));
360
        $this->assertInstanceOf(FormViewSubscriber::class, $this->container->get($formViewSubscriber));
361
362
        $gridViewSubscriber = 'lug.resource.rest.view.subscriber.grid';
363
        $this->assertTrue($this->container->getDefinition($gridViewSubscriber)->hasTag($tag));
364
        $this->assertInstanceOf(GridViewSubscriber::class, $this->container->get($gridViewSubscriber));
365
366
        $pagerfantaViewSubscriber = 'lug.resource.rest.view.subscriber.pagerfanta';
367
        $this->assertTrue($this->container->getDefinition($pagerfantaViewSubscriber)->hasTag($tag));
368
        $this->assertInstanceOf(PagerfantaViewSubscriber::class, $this->container->get($pagerfantaViewSubscriber));
369
370
        $resourceViewSubscriber = 'lug.resource.rest.view.subscriber.resource';
371
        $this->assertTrue($this->container->getDefinition($resourceViewSubscriber)->hasTag($tag));
372
        $this->assertInstanceOf(ResourceViewSubscriber::class, $this->container->get($resourceViewSubscriber));
373
    }
374
375
    public function testRouting()
376
    {
377
        $this->compileContainer();
378
379
        $this->assertInstanceOf(
380
            ParameterResolver::class,
381
            $this->container->get('lug.resource.routing.parameter_resolver.internal')
382
        );
383
384
        $this->assertInstanceOf(
385
            CachedParameterResolver::class,
386
            $this->container->get('lug.resource.routing.parameter_resolver')
387
        );
388
    }
389
390
    public function testSecurity()
391
    {
392
        $this->compileContainer();
393
394
        $this->assertInstanceOf(SecurityChecker::class, $this->container->get('lug.resource.security.checker'));
395
    }
396
397
    /**
398
     * @param ContainerBuilder $container
399
     * @param string           $configuration
400
     */
401
    abstract protected function loadConfiguration(ContainerBuilder $container, $configuration);
402
403
    /**
404
     * @param string|null $configuration
405
     */
406
    private function compileContainer($configuration = null)
407
    {
408
        if ($configuration !== null) {
409
            $this->loadConfiguration($this->container, $configuration);
410
        }
411
412
        $this->container->compile();
413
    }
414
415
    /**
416
     * @return \PHPUnit_Framework_MockObject_MockObject|AuthorizationCheckerInterface
417
     */
418
    private function createAuthorizationCheckerMock()
419
    {
420
        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...
421
    }
422
423
    /**
424
     * @return \PHPUnit_Framework_MockObject_MockObject|TranslatorInterface
425
     */
426
    private function createTranslatorMock()
427
    {
428
        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...
429
    }
430
431
    /**
432
     * @return \PHPUnit_Framework_MockObject_MockObject|PropertyAccessorInterface
433
     */
434
    private function createPropertyAccessorMock()
435
    {
436
        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...
437
    }
438
439
    /**
440
     * @return \PHPUnit_Framework_MockObject_MockObject|Session
441
     */
442
    private function createSessionMock()
443
    {
444
        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...
445
    }
446
447
    /**
448
     * @return \PHPUnit_Framework_MockObject_MockObject|FormFactoryInterface
449
     */
450
    private function createFormFactoryMock()
451
    {
452
        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...
453
    }
454
455
    /**
456
     * @return \PHPUnit_Framework_MockObject_MockObject|FormRendererInterface
457
     */
458
    private function createFormRendererMock()
459
    {
460
        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...
461
    }
462
463
    /**
464
     * @return \PHPUnit_Framework_MockObject_MockObject|RegistryInterface
465
     */
466
    private function createRegistryMock()
467
    {
468
        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...
469
    }
470
471
    /**
472
     * @return \PHPUnit_Framework_MockObject_MockObject|RouterInterface
473
     */
474
    private function createRouterMock()
475
    {
476
        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...
477
    }
478
479
    /**
480
     * @return \PHPUnit_Framework_MockObject_MockObject|RequestStack
481
     */
482
    private function createRequestStackMock()
483
    {
484
        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...
485
    }
486
487
    /**
488
     * @return \PHPUnit_Framework_MockObject_MockObject|GridHandlerInterface
489
     */
490
    private function createGridHandler()
491
    {
492
        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...
493
    }
494
}
495