Code Duplication    Length = 18-21 lines in 6 locations

Tests/DependencyInjection/ConfigurationTest.php 6 locations

@@ 97-117 (lines=21) @@
94
        $this->assertArrayHasKey('anotherLoader', $config['loaders']);
95
    }
96
97
    public function testSetFilesystemLoaderAsDefaultLoaderIfNotDefined()
98
    {
99
        $config = $this->processConfiguration(
100
            new Configuration(
101
                array(
102
                    new WebPathResolverFactory(),
103
                ),
104
                array(
105
                    new FileSystemLoaderFactory(),
106
                )
107
            ),
108
            array(array(
109
                'loaders' => array(
110
                ),
111
            ))
112
        );
113
114
        $this->assertArrayHasKey('loaders', $config);
115
        $this->assertArrayHasKey('default', $config['loaders']);
116
        $this->assertArrayHasKey('filesystem', $config['loaders']['default']);
117
    }
118
119
    public function testSetFilesystemLoaderAsDefaultLoaderIfNull()
120
    {
@@ 119-138 (lines=20) @@
116
        $this->assertArrayHasKey('filesystem', $config['loaders']['default']);
117
    }
118
119
    public function testSetFilesystemLoaderAsDefaultLoaderIfNull()
120
    {
121
        $config = $this->processConfiguration(
122
            new Configuration(
123
                array(
124
                    new WebPathResolverFactory(),
125
                ),
126
                array(
127
                    new FileSystemLoaderFactory(),
128
                )
129
            ),
130
            array(array(
131
                'loaders' => null,
132
            ))
133
        );
134
135
        $this->assertArrayHasKey('loaders', $config);
136
        $this->assertArrayHasKey('default', $config['loaders']);
137
        $this->assertArrayHasKey('filesystem', $config['loaders']['default']);
138
    }
139
140
    public function testThrowIfLoadersNotArray()
141
    {
@@ 158-175 (lines=18) @@
155
        );
156
    }
157
158
    public function testSetFilesystemLoaderAsDefaultIfLoadersSectionNotDefined()
159
    {
160
        $config = $this->processConfiguration(
161
            new Configuration(
162
                array(
163
                    new WebPathResolverFactory(),
164
                ),
165
                array(
166
                    new FileSystemLoaderFactory(),
167
                )
168
            ),
169
            array(array())
170
        );
171
172
        $this->assertArrayHasKey('loaders', $config);
173
        $this->assertArrayHasKey('default', $config['loaders']);
174
        $this->assertArrayHasKey('filesystem', $config['loaders']['default']);
175
    }
176
177
    public function testSetWebPathResolversAsDefaultIfResolversSectionNotDefined()
178
    {
@@ 177-194 (lines=18) @@
174
        $this->assertArrayHasKey('filesystem', $config['loaders']['default']);
175
    }
176
177
    public function testSetWebPathResolversAsDefaultIfResolversSectionNotDefined()
178
    {
179
        $config = $this->processConfiguration(
180
            new Configuration(
181
                array(
182
                    new WebPathResolverFactory(),
183
                ),
184
                array(
185
                    new FileSystemLoaderFactory(),
186
                )
187
            ),
188
            array(array())
189
        );
190
191
        $this->assertArrayHasKey('resolvers', $config);
192
        $this->assertArrayHasKey('default', $config['resolvers']);
193
        $this->assertArrayHasKey('web_path', $config['resolvers']['default']);
194
    }
195
196
    public function testShouldNotOverwriteDefaultLoaderIfDefined()
197
    {
@@ 289-308 (lines=20) @@
286
        $this->assertArrayHasKey('anotherResolver', $config['resolvers']);
287
    }
288
289
    public function testSetWebPathAsDefaultResolverIfNotDefined()
290
    {
291
        $config = $this->processConfiguration(
292
            new Configuration(
293
                array(
294
                    new WebPathResolverFactory(),
295
                ), array(
296
                    new FileSystemLoaderFactory(),
297
                )
298
            ),
299
            array(array(
300
                'resolvers' => array(
301
                ),
302
            ))
303
        );
304
305
        $this->assertArrayHasKey('resolvers', $config);
306
        $this->assertArrayHasKey('default', $config['resolvers']);
307
        $this->assertArrayHasKey('web_path', $config['resolvers']['default']);
308
    }
309
310
    public function testSetWebPathAsDefaultResolverIfNull()
311
    {
@@ 310-328 (lines=19) @@
307
        $this->assertArrayHasKey('web_path', $config['resolvers']['default']);
308
    }
309
310
    public function testSetWebPathAsDefaultResolverIfNull()
311
    {
312
        $config = $this->processConfiguration(
313
            new Configuration(
314
                array(
315
                    new WebPathResolverFactory(),
316
                ), array(
317
                    new FileSystemLoaderFactory(),
318
                )
319
            ),
320
            array(array(
321
                'resolvers' => null,
322
            ))
323
        );
324
325
        $this->assertArrayHasKey('resolvers', $config);
326
        $this->assertArrayHasKey('default', $config['resolvers']);
327
        $this->assertArrayHasKey('web_path', $config['resolvers']['default']);
328
    }
329
330
    public function testThrowsIfResolversNotArray()
331
    {