CodeGeneratorEventDispatcherTest   B
last analyzed

Complexity

Total Complexity 51

Size/Duplication

Total Lines 323
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 51
eloc 104
c 4
b 0
f 0
dl 0
loc 323
rs 7.92

77 Methods

Rating   Name   Duplication   Size   Complexity  
A hp$0 ➔ onBaseBeanCloneGenerated() 0 3 1
A hp$0 ➔ onBaseBeanConstructorGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindFromSqlGenerated() 0 3 1
A hp$0 ➔ onBaseDaoGetByIdGenerated() 0 3 1
A hp$0 ➔ onBaseDaoDeleteGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindByIndexGenerated() 0 3 1
A hp$0 ➔ onBaseBeanOneToManyGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindOneGenerated() 0 3 1
A hp$0 ➔ onBaseDaoSaveGenerated() 0 3 1
A hp$0 ➔ onBaseDaoGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindOneFromSqlGenerated() 0 3 1
A hp$0 ➔ onBaseDaoConstructorGenerated() 0 3 1
A hp$0 ➔ onBaseBeanGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindGenerated() 0 3 1
A hp$0 ➔ onBaseBeanJsonSerializeGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindAllGenerated() 0 3 1
A hp$0 ➔ onBaseDaoSetDefaultSortGenerated() 0 3 1
A hp$0 ➔ onBaseDaoFindFromRawSqlGenerated() 0 3 1
A hp$0 ➔ onBaseBeanManyToManyGenerated() 0 3 1
A hp$0 ➔ onBaseBeanPropertyGenerated() 0 3 1
testOnBaseBeanCloneGenerated() 0 4 ?
A hp$0 ➔ testOnBaseDaoFindAllGenerated() 0 4 1
testOnBaseBeanPropertyGenerated() 0 4 ?
testOnBaseDaoFindAllGenerated() 0 4 ?
testOnBaseDaoConstructorGenerated() 0 4 ?
testOnBaseDaoFindFromRawSqlGenerated() 0 4 ?
A hp$0 ➔ onDaoFactoryGenerated() 0 3 1
A hp$0 ➔ testOnBaseDaoFindGenerated() 0 4 1
testOnDaoFactorySetterGenerated() 0 4 ?
A hp$0 ➔ testOnBaseBeanJsonSerializeGenerated() 0 4 1
A hp$0 ➔ testOnDaoFactoryGenerated() 0 4 1
testOnBaseDaoFindGenerated() 0 4 ?
testOnBaseDaoFindOneFromSqlGenerated() 0 4 ?
A hp$0 ➔ testOnDaoFactoryGetterGenerated() 0 4 1
A hp$0 ➔ onDaoFactoryGetterGenerated() 0 3 1
testOnBaseDaoSetDefaultSortGenerated() 0 4 ?
B hp$0 ➔ setUp() 0 152 1
A hp$0 ➔ testOnBaseDaoSaveGenerated() 0 4 1
A hp$0 ➔ testOnBaseDaoSetDefaultSortGenerated() 0 4 1
A hp$0 ➔ testOnBaseBeanPropertyGenerated() 0 4 1
A hp$0 ➔ testOnBaseBeanCloneGenerated() 0 4 1
A hp$0 ➔ testOnBaseDaoConstructorGenerated() 0 4 1
testOnBaseBeanManyToManyGenerated() 0 4 ?
testOnBaseResultIteratorGenerated() 0 4 ?
testOnBaseDaoFindByIndexGenerated() 0 5 ?
A hp$0 ➔ onDaoFactorySetterGenerated() 0 3 1
A hp$0 ➔ testOnBaseBeanConstructorGenerated() 0 4 1
testOnBaseDaoGetByIdGenerated() 0 4 ?
testOnBaseDaoDeleteGenerated() 0 4 ?
testOnBaseDaoSaveGenerated() 0 4 ?
testOnBaseDaoFindFromSqlGenerated() 0 4 ?
testOnBaseDaoGenerated() 0 4 ?
A hp$0 ➔ testOnBaseResultIteratorGenerated() 0 4 1
testOnBaseBeanJsonSerializeGenerated() 0 4 ?
A hp$0 ➔ testOnBaseDaoFindOneFromSqlGenerated() 0 4 1
A hp$0 ➔ testOnBaseBeanManyToManyGenerated() 0 4 1
A hp$0 ➔ onBaseResultIteratorGenerated() 0 3 1
A hp$0 ➔ testOnBaseDaoFindFromRawSqlGenerated() 0 4 1
testOnDaoFactoryGenerated() 0 4 ?
setUp() 0 152 ?
testOnBaseBeanGenerated() 0 4 ?
A hp$0 ➔ onDaoFactoryConstructorGenerated() 0 3 1
A hp$0 ➔ testOnBaseBeanOneToManyGenerated() 0 5 1
A hp$0 ➔ testOnBaseDaoFindByIndexGenerated() 0 5 1
A hp$0 ➔ testOnDaoFactorySetterGenerated() 0 4 1
A hp$0 ➔ testOnBaseBeanGenerated() 0 4 1
A hp$0 ➔ testOnBaseDaoGetByIdGenerated() 0 4 1
testOnDaoFactoryConstructorGenerated() 0 4 ?
A hp$0 ➔ testOnBaseDaoGenerated() 0 4 1
A hp$0 ➔ testOnDaoFactoryConstructorGenerated() 0 4 1
testOnDaoFactoryGetterGenerated() 0 4 ?
testOnBaseDaoFindOneGenerated() 0 4 ?
testOnBaseBeanOneToManyGenerated() 0 5 ?
A hp$0 ➔ testOnBaseDaoFindFromSqlGenerated() 0 4 1
A hp$0 ➔ testOnBaseDaoDeleteGenerated() 0 4 1
A hp$0 ➔ testOnBaseDaoFindOneGenerated() 0 4 1
testOnBaseBeanConstructorGenerated() 0 4 ?

How to fix   Complexity   

Complex Class

Complex classes like CodeGeneratorEventDispatcherTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use CodeGeneratorEventDispatcherTest, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace TheCodingMachine\TDBM\Utils;
4
5
use Doctrine\DBAL\Schema\Index;
6
use PHPUnit\Framework\TestCase;
7
use TheCodingMachine\TDBM\ConfigurationInterface;
8
use Laminas\Code\Generator\ClassGenerator;
9
use Laminas\Code\Generator\FileGenerator;
10
use Laminas\Code\Generator\MethodGenerator;
11
12
class CodeGeneratorEventDispatcherTest extends TestCase
13
{
14
    /**
15
     * @var CodeGeneratorEventDispatcher
16
     */
17
    private $dispatcher;
18
    private $method1;
19
    private $method2;
20
    private $method3;
21
    private $method4;
22
    private $method5;
23
    private $beanDescriptor;
24
    private $configuration;
25
    private $class;
26
    private $file;
27
    private $pivotTableMethodsDescriptor;
28
    private $beanPropertyDescriptor;
29
    private $nullDispatcher;
30
31
    public function setUp(): void
32
    {
33
        $this->dispatcher = new CodeGeneratorEventDispatcher([new BaseCodeGeneratorListener()]);
34
        $this->nullDispatcher = new CodeGeneratorEventDispatcher([new class () implements CodeGeneratorListenerInterface {
35
            public function onBaseBeanGenerated(FileGenerator $fileGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration): ?FileGenerator
36
            {
37
                return null;
38
            }
39
40
            public function onBaseBeanConstructorGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
41
            {
42
                return null;
43
            }
44
45
            public function onBaseBeanPropertyGenerated(?MethodGenerator $getter, ?MethodGenerator $setter, AbstractBeanPropertyDescriptor $propertyDescriptor, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): array
46
            {
47
                return [null, null];
48
            }
49
50
            public function onBaseBeanOneToManyGenerated(MethodGenerator $getter, DirectForeignKeyMethodDescriptor $directForeignKeyMethodDescriptor, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
51
            {
52
                return null;
53
            }
54
55
            public function onBaseBeanManyToManyGenerated(?MethodGenerator $getter, ?MethodGenerator $adder, ?MethodGenerator $remover, ?MethodGenerator $hasser, ?MethodGenerator $setter, PivotTableMethodsDescriptor $pivotTableMethodsDescriptor, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): array
56
            {
57
                return [null, null, null, null, null];
58
            }
59
60
            public function onBaseBeanJsonSerializeGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
61
            {
62
                return null;
63
            }
64
65
            public function onBaseBeanCloneGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
66
            {
67
                return null;
68
            }
69
70
            public function onBaseDaoGenerated(FileGenerator $fileGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration): ?FileGenerator
71
            {
72
                return null;
73
            }
74
75
            public function onBaseDaoConstructorGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
76
            {
77
                return null;
78
            }
79
80
            public function onBaseDaoSaveGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
81
            {
82
                return null;
83
            }
84
85
            public function onBaseDaoFindAllGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
86
            {
87
                return null;
88
            }
89
90
            public function onBaseDaoGetByIdGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
91
            {
92
                return null;
93
            }
94
95
            public function onBaseDaoDeleteGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
96
            {
97
                return null;
98
            }
99
100
            public function onBaseDaoFindGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
101
            {
102
                return null;
103
            }
104
105
            public function onBaseDaoFindFromSqlGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
106
            {
107
                return null;
108
            }
109
110
            public function onBaseDaoFindFromRawSqlGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
111
            {
112
                return null;
113
            }
114
115
            public function onBaseDaoFindOneGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
116
            {
117
                return null;
118
            }
119
120
            public function onBaseDaoFindOneFromSqlGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
121
            {
122
                return null;
123
            }
124
125
            public function onBaseDaoSetDefaultSortGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
126
            {
127
                return null;
128
            }
129
130
            public function onBaseDaoFindByIndexGenerated(MethodGenerator $methodGenerator, Index $index, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
131
            {
132
                return null;
133
            }
134
135
            public function onBaseResultIteratorGenerated(FileGenerator $fileGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration): ?FileGenerator
136
            {
137
                return null;
138
            }
139
140
            /**
141
             * @param BeanDescriptor[] $beanDescriptors
142
             */
143
            public function onDaoFactoryGenerated(FileGenerator $fileGenerator, array $beanDescriptors, ConfigurationInterface $configuration): ?FileGenerator
144
            {
145
                return null;
146
            }
147
148
            /**
149
             * @param BeanDescriptor[] $beanDescriptors
150
             */
151
            public function onDaoFactoryConstructorGenerated(MethodGenerator $methodGenerator, array $beanDescriptors, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
152
            {
153
                return null;
154
            }
155
156
            /**
157
             * @param BeanDescriptor[] $beanDescriptor
158
             */
159
            public function onDaoFactoryGetterGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
160
            {
161
                return null;
162
            }
163
164
            /**
165
             * @param BeanDescriptor[] $beanDescriptor
166
             */
167
            public function onDaoFactorySetterGenerated(MethodGenerator $methodGenerator, BeanDescriptor $beanDescriptor, ConfigurationInterface $configuration, ClassGenerator $classGenerator): ?MethodGenerator
168
            {
169
                return null;
170
            }
171
        }]);
172
        $this->method1 = new MethodGenerator();
173
        $this->method2 = new MethodGenerator();
174
        $this->method3 = new MethodGenerator();
175
        $this->method4 = new MethodGenerator();
176
        $this->method5 = new MethodGenerator();
177
        $this->beanDescriptor = $this->getMockBuilder(BeanDescriptor::class)->disableOriginalConstructor()->getMock();
178
        $this->configuration = $this->getMockBuilder(ConfigurationInterface::class)->disableOriginalConstructor()->getMock();
179
        $this->pivotTableMethodsDescriptor = $this->getMockBuilder(PivotTableMethodsDescriptor::class)->disableOriginalConstructor()->getMock();
180
        $this->beanPropertyDescriptor = $this->getMockBuilder(ScalarBeanPropertyDescriptor::class)->disableOriginalConstructor()->getMock();
181
        $this->class = new ClassGenerator();
182
        $this->file = new FileGenerator();
183
    }
184
185
    public function testOnBaseDaoFindAllGenerated(): void
186
    {
187
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindAllGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
188
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindAllGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
189
    }
190
191
    public function testOnBaseBeanJsonSerializeGenerated(): void
192
    {
193
        $this->assertSame($this->method1, $this->dispatcher->onBaseBeanJsonSerializeGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
194
        $this->assertSame(null, $this->nullDispatcher->onBaseBeanJsonSerializeGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
195
    }
196
197
    public function testOnBaseDaoConstructorGenerated(): void
198
    {
199
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoConstructorGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
200
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoConstructorGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
201
    }
202
203
    public function testOnBaseDaoFindOneFromSqlGenerated(): void
204
    {
205
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindOneFromSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
206
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindOneFromSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
207
    }
208
209
    public function testOnBaseDaoGenerated(): void
210
    {
211
        $this->assertSame($this->file, $this->dispatcher->onBaseDaoGenerated($this->file, $this->beanDescriptor, $this->configuration));
212
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoGenerated($this->file, $this->beanDescriptor, $this->configuration));
213
    }
214
215
    public function testOnBaseDaoSetDefaultSortGenerated(): void
216
    {
217
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoSetDefaultSortGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
218
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoSetDefaultSortGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
219
    }
220
221
    public function testOnBaseDaoSaveGenerated(): void
222
    {
223
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoSaveGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
224
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoSaveGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
225
    }
226
227
    public function testOnBaseDaoGetByIdGenerated(): void
228
    {
229
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoGetByIdGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
230
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoGetByIdGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
231
    }
232
233
    public function testOnBaseBeanCloneGenerated(): void
234
    {
235
        $this->assertSame($this->method1, $this->dispatcher->onBaseBeanCloneGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
236
        $this->assertSame(null, $this->nullDispatcher->onBaseBeanCloneGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
237
    }
238
239
    public function testOnBaseDaoFindOneGenerated(): void
240
    {
241
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindOneGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
242
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindOneGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
243
    }
244
245
    public function testOnBaseBeanPropertyGenerated(): void
246
    {
247
        $this->assertSame([$this->method1, $this->method2], $this->dispatcher->onBaseBeanPropertyGenerated($this->method1, $this->method2, $this->beanPropertyDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
248
        $this->assertSame([null, null], $this->nullDispatcher->onBaseBeanPropertyGenerated(null, null, $this->beanPropertyDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
249
    }
250
251
    public function testOnBaseDaoFindGenerated(): void
252
    {
253
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
254
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
255
    }
256
257
    public function testOnBaseBeanOneToManyGenerated(): void
258
    {
259
        $directForeignKeyMethodDescriptor = $this->getMockBuilder(DirectForeignKeyMethodDescriptor::class)->disableOriginalConstructor()->getMock();
260
        $this->assertSame($this->method1, $this->dispatcher->onBaseBeanOneToManyGenerated($this->method1, $directForeignKeyMethodDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
261
        $this->assertSame(null, $this->nullDispatcher->onBaseBeanOneToManyGenerated($this->method1, $directForeignKeyMethodDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
262
    }
263
264
    public function testOnBaseDaoFindFromSqlGenerated(): void
265
    {
266
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindFromSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
267
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindFromSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
268
    }
269
270
    public function testOnBaseBeanConstructorGenerated(): void
271
    {
272
        $this->assertSame($this->method1, $this->dispatcher->onBaseBeanConstructorGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
273
        $this->assertSame(null, $this->nullDispatcher->onBaseBeanConstructorGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
274
    }
275
276
    public function testOnBaseDaoFindFromRawSqlGenerated(): void
277
    {
278
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindFromRawSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
279
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindFromRawSqlGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
280
    }
281
282
    public function testOnBaseDaoDeleteGenerated(): void
283
    {
284
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoDeleteGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
285
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoDeleteGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
286
    }
287
288
    public function testOnBaseBeanGenerated(): void
289
    {
290
        $this->assertSame($this->file, $this->dispatcher->onBaseBeanGenerated($this->file, $this->beanDescriptor, $this->configuration));
291
        $this->assertSame(null, $this->nullDispatcher->onBaseBeanGenerated($this->file, $this->beanDescriptor, $this->configuration));
292
    }
293
294
    public function testOnBaseBeanManyToManyGenerated(): void
295
    {
296
        $this->assertSame([$this->method1, $this->method2, $this->method3, $this->method4, $this->method5], $this->dispatcher->onBaseBeanManyToManyGenerated($this->method1, $this->method2, $this->method3, $this->method4, $this->method5, $this->pivotTableMethodsDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
297
        $this->assertSame([null, null, null, null, null], $this->nullDispatcher->onBaseBeanManyToManyGenerated(null, null, null, null, null, $this->pivotTableMethodsDescriptor, $this->beanDescriptor, $this->configuration, $this->class));
298
    }
299
300
    public function testOnBaseDaoFindByIndexGenerated(): void
301
    {
302
        $index = $this->getMockBuilder(Index::class)->disableOriginalConstructor()->getMock();
303
        $this->assertSame($this->method1, $this->dispatcher->onBaseDaoFindByIndexGenerated($this->method1, $index, $this->beanDescriptor, $this->configuration, $this->class));
304
        $this->assertSame(null, $this->nullDispatcher->onBaseDaoFindByIndexGenerated($this->method1, $index, $this->beanDescriptor, $this->configuration, $this->class));
305
    }
306
307
    public function testOnBaseResultIteratorGenerated(): void
308
    {
309
        $this->assertSame($this->file, $this->dispatcher->onBaseResultIteratorGenerated($this->file, $this->beanDescriptor, $this->configuration));
310
        $this->assertSame(null, $this->nullDispatcher->onBaseResultIteratorGenerated($this->file, $this->beanDescriptor, $this->configuration));
311
    }
312
313
    public function testOnDaoFactoryGenerated(): void
314
    {
315
        $this->assertSame($this->file, $this->dispatcher->onDaoFactoryGenerated($this->file, [], $this->configuration));
316
        $this->assertSame(null, $this->nullDispatcher->onDaoFactoryGenerated($this->file, [], $this->configuration));
317
    }
318
319
    public function testOnDaoFactoryConstructorGenerated(): void
320
    {
321
        $this->assertSame($this->method1, $this->dispatcher->onDaoFactoryConstructorGenerated($this->method1, [], $this->configuration, $this->class));
322
        $this->assertSame(null, $this->nullDispatcher->onDaoFactoryConstructorGenerated($this->method1, [], $this->configuration, $this->class));
323
    }
324
325
    public function testOnDaoFactoryGetterGenerated(): void
326
    {
327
        $this->assertSame($this->method1, $this->dispatcher->onDaoFactoryGetterGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
328
        $this->assertSame(null, $this->nullDispatcher->onDaoFactoryGetterGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
329
    }
330
331
    public function testOnDaoFactorySetterGenerated(): void
332
    {
333
        $this->assertSame($this->method1, $this->dispatcher->onDaoFactorySetterGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
334
        $this->assertSame(null, $this->nullDispatcher->onDaoFactorySetterGenerated($this->method1, $this->beanDescriptor, $this->configuration, $this->class));
335
    }
336
}
337