Code Duplication    Length = 12-14 lines in 2 locations

Tests/DataSource/Util/ChoicesBuilderTest.php 2 locations

@@ 10-21 (lines=12) @@
7
8
class ChoicesBuilderTest extends TestCase
9
{
10
    public function testBuildingChoicesWithInvalidConfig()
11
    {
12
        $invalidConfig = 'invalid configuration';
13
14
        $emMock = $this->prepareEntityManagerMock();
15
16
        $builder = new ChoicesBuilder($emMock);
17
18
        $this->expectException(\Exception::class);
19
        $this->expectExceptionMessage('No usable configuration was found');
20
        $builder->build($invalidConfig);
21
    }
22
23
    public function testBuildingChoicesFromRepositoryField()
24
    {
@@ 236-249 (lines=14) @@
233
        $this->assertSame($expectedChoices, $choices);
234
    }
235
236
    public function testBuildingChoicesFromCallableWhenResultIsNotAnArray()
237
    {
238
        $aCallable = function () {
239
            return 'not an array';
240
        };
241
242
        $emMock = $this->prepareEntityManagerMock();
243
244
        $builder = new ChoicesBuilder($emMock);
245
246
        $this->expectException(\Exception::class);
247
        $this->expectExceptionMessage('The provided choice callback must return an array of choices');
248
        $builder->build($aCallable);
249
    }
250
251
    /**
252
     * @return \PHPUnit_Framework_MockObject_MockObject