testCanInstantiateWithSecondLevelCacheConfig()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 58

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 58
rs 8.9163
c 0
b 0
f 0
cc 1
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace DoctrineORMModuleTest\Service;
4
5
use PHPUnit\Framework\TestCase;
6
use DoctrineORMModule\Service\ConfigurationFactory;
7
use Doctrine\Common\Cache\ArrayCache;
8
use Laminas\ServiceManager\ServiceManager;
9
10
class ConfigurationFactoryTest extends TestCase
11
{
12
    /**
13
     * @var ServiceManager
14
     */
15
    protected $serviceManager;
16
    /**
17
     * @var ConfigurationFactory
18
     */
19
    protected $factory;
20
21
    /**
22
     * {@inheritDoc}
23
     */
24
    public function setUp() : void
25
    {
26
        $this->serviceManager = new ServiceManager();
27
        $this->factory = new ConfigurationFactory('test_default');
28
        $this->serviceManager->setService('doctrine.cache.array', new ArrayCache());
29
        $this->serviceManager->setService(
30
            'doctrine.driver.orm_default',
31
            $this->createMock(\Doctrine\Common\Persistence\Mapping\Driver\MappingDriver::class)
0 ignored issues
show
Documentation introduced by
$this->createMock(\Doctr...r\MappingDriver::class) is of type null, but the function expects a array|object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
32
        );
33
    }
34
35
    public function testWillInstantiateConfigWithoutNamingStrategySetting()
36
    {
37
        $config = [
38
            'doctrine' => [
39
                'configuration' => [
40
                    'test_default' => [],
41
                ],
42
            ],
43
        ];
44
        $this->serviceManager->setService('config', $config);
45
        $ormConfig = $this->factory->createService($this->serviceManager);
46
        $this->assertInstanceOf(\Doctrine\ORM\Mapping\NamingStrategy::class, $ormConfig->getNamingStrategy());
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
47
    }
48
49
    public function testWillInstantiateConfigWithNamingStrategyObject()
50
    {
51
        $namingStrategy = $this->createMock(\Doctrine\ORM\Mapping\NamingStrategy::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $namingStrategy is correct as $this->createMock(\Doctr...\NamingStrategy::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
52
53
        $config = [
54
            'doctrine' => [
55
                'configuration' => [
56
                    'test_default' => [
57
                        'naming_strategy' => $namingStrategy,
58
                    ],
59
                ],
60
            ],
61
        ];
62
        $this->serviceManager->setService('config', $config);
63
        $factory = new ConfigurationFactory('test_default');
64
        $ormConfig = $factory->createService($this->serviceManager);
65
        $this->assertSame($namingStrategy, $ormConfig->getNamingStrategy());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
66
    }
67
68
    public function testWillInstantiateConfigWithNamingStrategyReference()
69
    {
70
        $namingStrategy = $this->createMock(\Doctrine\ORM\Mapping\NamingStrategy::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $namingStrategy is correct as $this->createMock(\Doctr...\NamingStrategy::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
71
        $config = [
72
            'doctrine' => [
73
                'configuration' => [
74
                    'test_default' => [
75
                        'naming_strategy' => 'test_naming_strategy',
76
                    ],
77
                ],
78
            ],
79
        ];
80
        $this->serviceManager->setService('config', $config);
81
        $this->serviceManager->setService('test_naming_strategy', $namingStrategy);
0 ignored issues
show
Documentation introduced by
$namingStrategy is of type null, but the function expects a array|object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
82
        $ormConfig = $this->factory->createService($this->serviceManager);
83
        $this->assertSame($namingStrategy, $ormConfig->getNamingStrategy());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
84
    }
85
86
    public function testWillNotInstantiateConfigWithInvalidNamingStrategyReference()
87
    {
88
        $config = [
89
            'doctrine' => [
90
                'configuration' => [
91
                    'test_default' => [
92
                        'naming_strategy' => 'test_naming_strategy',
93
                    ],
94
                ],
95
            ],
96
        ];
97
        $this->serviceManager->setService('config', $config);
98
        $this->expectException(\Laminas\ServiceManager\Exception\InvalidArgumentException::class);
0 ignored issues
show
Bug introduced by
The method expectException() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
99
        $this->factory->createService($this->serviceManager);
100
    }
101
102
    public function testWillInstantiateConfigWithQuoteStrategyObject()
103
    {
104
        $quoteStrategy = $this->createMock(\Doctrine\ORM\Mapping\QuoteStrategy::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $quoteStrategy is correct as $this->createMock(\Doctr...g\QuoteStrategy::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
105
106
        $config = [
107
            'doctrine' => [
108
                'configuration' => [
109
                    'test_default' => [
110
                        'quote_strategy' => $quoteStrategy,
111
                    ],
112
                ],
113
            ],
114
        ];
115
        $this->serviceManager->setService('config', $config);
116
        $factory = new ConfigurationFactory('test_default');
117
        $ormConfig = $factory->createService($this->serviceManager);
118
        $this->assertSame($quoteStrategy, $ormConfig->getQuoteStrategy());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
119
    }
120
121
    public function testWillInstantiateConfigWithQuoteStrategyReference()
122
    {
123
        $quoteStrategy = $this->createMock(\Doctrine\ORM\Mapping\QuoteStrategy::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $quoteStrategy is correct as $this->createMock(\Doctr...g\QuoteStrategy::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
124
        $config = [
125
            'doctrine' => [
126
                'configuration' => [
127
                    'test_default' => [
128
                        'quote_strategy' => 'test_quote_strategy',
129
                    ],
130
                ],
131
            ],
132
        ];
133
        $this->serviceManager->setService('config', $config);
134
        $this->serviceManager->setService('test_quote_strategy', $quoteStrategy);
0 ignored issues
show
Documentation introduced by
$quoteStrategy is of type null, but the function expects a array|object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
135
        $ormConfig = $this->factory->createService($this->serviceManager);
136
        $this->assertSame($quoteStrategy, $ormConfig->getQuoteStrategy());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
137
    }
138
139
    public function testWillNotInstantiateConfigWithInvalidQuoteStrategyReference()
140
    {
141
        $config = [
142
            'doctrine' => [
143
                'configuration' => [
144
                    'test_default' => [
145
                        'quote_strategy' => 'test_quote_strategy',
146
                    ],
147
                ],
148
            ],
149
        ];
150
        $this->serviceManager->setService('config', $config);
151
        $this->expectException(\Laminas\ServiceManager\Exception\InvalidArgumentException::class);
0 ignored issues
show
Bug introduced by
The method expectException() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
152
        $this->factory->createService($this->serviceManager);
153
    }
154
155
    public function testWillInstantiateConfigWithHydrationCacheSetting()
156
    {
157
        $config = [
158
            'doctrine' => [
159
                'configuration' => [
160
                    'test_default' => [
161
                        'hydration_cache' => 'array',
162
                    ],
163
                ],
164
            ],
165
        ];
166
        $this->serviceManager->setService('config', $config);
167
        $factory = new ConfigurationFactory('test_default');
168
        $ormConfig = $factory->createService($this->serviceManager);
169
        $this->assertInstanceOf(\Doctrine\Common\Cache\ArrayCache::class, $ormConfig->getHydrationCacheImpl());
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
170
    }
171
172
    public function testCanSetDefaultRepositoryClass()
173
    {
174
        $config = [
175
            'doctrine' => [
176
                'configuration' => [
177
                    'test_default' => [
178
179
                        'hydration_cache' => 'array',
180
                        'default_repository_class_name' => \DoctrineORMModuleTest\Assets\RepositoryClass::class,
181
                    ],
182
                ],
183
            ],
184
        ];
185
        $this->serviceManager->setService('config', $config);
186
187
        $factory = new ConfigurationFactory('test_default');
188
        $ormConfig = $factory->createService($this->serviceManager);
189
        $this->assertInstanceOf(\Doctrine\Common\Cache\ArrayCache::class, $ormConfig->getHydrationCacheImpl());
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
190
    }
191
192
    public function testAcceptsMetadataFactory()
193
    {
194
        $config = [
195
            'doctrine' => [
196
                'configuration' => [
197
                    'test_default' => [
198
                        'classMetadataFactoryName' => 'Factory',
199
                    ],
200
                ],
201
            ],
202
        ];
203
        $this->serviceManager->setService('config', $config);
204
        $factory = new ConfigurationFactory('test_default');
205
        $ormConfig = $factory->createService($this->serviceManager);
206
        $this->assertEquals('Factory', $ormConfig->getClassMetadataFactoryName());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
207
    }
208
209
    public function testDefaultMetadatFactory()
210
    {
211
        $config = [
212
            'doctrine' => [
213
                'configuration' => [
214
                    'test_default' => [
215
                    ],
216
                ],
217
            ],
218
        ];
219
        $this->serviceManager->setService('config', $config);
220
        $factory = new ConfigurationFactory('test_default');
221
        $ormConfig = $factory->createService($this->serviceManager);
222
        $this->assertEquals(
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
223
            \Doctrine\ORM\Mapping\ClassMetadataFactory::class,
224
            $ormConfig->getClassMetadataFactoryName()
225
        );
226
    }
227
228
    public function testWillInstantiateConfigWithoutEntityListenerResolverSetting()
229
    {
230
        $config = [
231
            'doctrine' => [
232
                'configuration' => [
233
                    'test_default' => [],
234
                ],
235
            ],
236
        ];
237
238
        $this->serviceManager->setService('config', $config);
239
240
        $ormConfig = $this->factory->createService($this->serviceManager);
241
242
        $this->assertInstanceOf(
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
243
            \Doctrine\ORM\Mapping\EntityListenerResolver::class,
244
            $ormConfig->getEntityListenerResolver()
245
        );
246
    }
247
248
    public function testWillInstantiateConfigWithEntityListenerResolverObject()
249
    {
250
        $entityListenerResolver = $this->createMock(\Doctrine\ORM\Mapping\EntityListenerResolver::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $entityListenerResolver is correct as $this->createMock(\Doctr...istenerResolver::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
251
252
        $config = [
253
            'doctrine' => [
254
                'configuration' => [
255
                    'test_default' => [
256
                        'entity_listener_resolver' => $entityListenerResolver,
257
                    ],
258
                ],
259
            ],
260
        ];
261
262
        $this->serviceManager->setService('config', $config);
263
264
        $ormConfig = $this->factory->createService($this->serviceManager);
265
266
        $this->assertSame($entityListenerResolver, $ormConfig->getEntityListenerResolver());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
267
    }
268
269
    public function testWillInstantiateConfigWithEntityListenerResolverReference()
270
    {
271
        $entityListenerResolver = $this->createMock(\Doctrine\ORM\Mapping\EntityListenerResolver::class);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $entityListenerResolver is correct as $this->createMock(\Doctr...istenerResolver::class) (which targets PHPUnit\Framework\TestCase::createMock()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
272
273
        $config = [
274
            'doctrine' => [
275
                'configuration' => [
276
                    'test_default' => [
277
                        'entity_listener_resolver' => 'test_entity_listener_resolver',
278
                    ],
279
                ],
280
            ],
281
        ];
282
283
        $this->serviceManager->setService('config', $config);
284
        $this->serviceManager->setService('test_entity_listener_resolver', $entityListenerResolver);
0 ignored issues
show
Documentation introduced by
$entityListenerResolver is of type null, but the function expects a array|object.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
285
286
        $ormConfig = $this->factory->createService($this->serviceManager);
287
288
        $this->assertSame($entityListenerResolver, $ormConfig->getEntityListenerResolver());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
289
    }
290
291
    public function testDoNotCreateSecondLevelCacheByDefault()
292
    {
293
        $config = [
294
            'doctrine' => [
295
                'configuration' => [
296
                    'test_default' => [],
297
                ],
298
            ],
299
        ];
300
301
        $this->serviceManager->setService('config', $config);
302
303
        $ormConfig = $this->factory->createService($this->serviceManager);
304
305
        $this->assertNull($ormConfig->getSecondLevelCacheConfiguration());
0 ignored issues
show
Bug introduced by
The method assertNull() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
306
    }
307
308
    public function testCanInstantiateWithSecondLevelCacheConfig()
309
    {
310
        $config = [
311
            'doctrine' => [
312
                'configuration' => [
313
                    'test_default' => [
314
                        'result_cache' => 'array',
315
316
                        'second_level_cache' => [
317
                            'enabled'                    => true,
318
                            'default_lifetime'           => 200,
319
                            'default_lock_lifetime'      => 500,
320
                            'file_lock_region_directory' => 'my_dir',
321
322
                            'regions' => [
323
                                'my_first_region' => [
324
                                    'lifetime'      => 800,
325
                                    'lock_lifetime' => 1000,
326
                                ],
327
328
                                'my_second_region' => [
329
                                    'lifetime'      => 10,
330
                                    'lock_lifetime' => 20,
331
                                ],
332
                            ],
333
                        ],
334
                    ],
335
                ],
336
            ],
337
        ];
338
339
        $this->serviceManager->setService('config', $config);
340
341
        $ormConfig        = $this->factory->createService($this->serviceManager);
342
        $secondLevelCache = $ormConfig->getSecondLevelCacheConfiguration();
343
344
        $this->assertInstanceOf(\Doctrine\ORM\Cache\CacheConfiguration::class, $secondLevelCache);
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
345
346
        $cacheFactory = $secondLevelCache->getCacheFactory();
347
        $this->assertInstanceOf(\Doctrine\ORM\Cache\DefaultCacheFactory::class, $cacheFactory);
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
348
        $this->assertEquals('my_dir', $cacheFactory->getFileLockRegionDirectory());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
349
350
        $regionsConfiguration = $secondLevelCache->getRegionsConfiguration();
351
        $this->assertEquals(200, $regionsConfiguration->getDefaultLifetime());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
352
        $this->assertEquals(500, $regionsConfiguration->getDefaultLockLifetime());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
353
354
        $this->assertEquals(800, $regionsConfiguration->getLifetime('my_first_region'));
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
355
        $this->assertEquals(10, $regionsConfiguration->getLifetime('my_second_region'));
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
356
357
        $this->assertEquals(1000, $regionsConfiguration->getLockLifetime('my_first_region'));
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
358
        $this->assertEquals(20, $regionsConfiguration->getLockLifetime('my_second_region'));
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
359
360
        // Doctrine does not allow to retrieve the cache adapter from cache factory, so we are forced to use
361
        // reflection here
362
        $reflProperty = new \ReflectionProperty($cacheFactory, 'cache');
363
        $reflProperty->setAccessible(true);
364
        $this->assertInstanceOf(\Doctrine\Common\Cache\ArrayCache::class, $reflProperty->getValue($cacheFactory));
0 ignored issues
show
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<DoctrineORMModule...nfigurationFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
365
    }
366
}
367