Code Duplication    Length = 14-14 lines in 2 locations

src/Kunstmaan/AdminListBundle/Tests/unit/AdminList/Configurator/AbstractDoctrineDBALAdminListConfiguratorTest.php 1 location

@@ 168-181 (lines=14) @@
165
    /**
166
     * @throws \ReflectionException
167
     */
168
    public function testGetIterator()
169
    {
170
        $config = $this->config;
171
        $queryBuilder = $this->createMock(AbstractQuery::class);
172
        $queryBuilder->expects($this->once())->method('execute')->willReturn(new ArrayIterator());
173
174
        $mirror = new ReflectionClass(AbstractDoctrineDBALAdminListConfigurator::class);
175
        $property = $mirror->getProperty('queryBuilder');
176
        $property->setAccessible(true);
177
        $property->setValue($config, $queryBuilder);
178
179
        $it = $config->getIterator();
180
        $this->assertInstanceOf(ArrayIterator::class, $it);
181
    }
182
}
183

src/Kunstmaan/AdminListBundle/Tests/unit/AdminList/Configurator/AbstractDoctrineORMAdminListConfiguratorTest.php 1 location

@@ 216-229 (lines=14) @@
213
    /**
214
     * @throws \ReflectionException
215
     */
216
    public function testGetIterator()
217
    {
218
        $config = $this->config;
219
        $query = $this->createMock(AbstractQuery::class);
220
        $query->expects($this->once())->method('iterate')->willReturn(new ArrayIterator());
221
222
        $mirror = new ReflectionClass(AbstractDoctrineORMAdminListConfigurator::class);
223
        $property = $mirror->getProperty('query');
224
        $property->setAccessible(true);
225
        $property->setValue($config, $query);
226
227
        $it = $config->getIterator();
228
        $this->assertInstanceOf(ArrayIterator::class, $it);
229
    }
230
231
    /**
232
     * @throws \ReflectionException