Code Duplication    Length = 18-21 lines in 3 locations

Tests/Transformer/ModelToElasticaAutoTransformerTest.php 3 locations

@@ 300-317 (lines=18) @@
297
        );
298
    }
299
300
    public function testNestedMapping()
301
    {
302
        $transformer = $this->getTransformer();
303
        $document    = $transformer->transform(new POPO(), array(
304
            'sub' => array(
305
                'type' => 'nested',
306
                'properties' => array('foo' => array()),
307
            ),
308
        ));
309
        $data        = $document->getData();
310
311
        $this->assertTrue(array_key_exists('sub', $data));
312
        $this->assertInternalType('array', $data['sub']);
313
        $this->assertEquals(array(
314
             array('foo' => 'foo'),
315
             array('foo' => 'bar'),
316
           ), $data['sub']);
317
    }
318
319
    public function tesObjectMapping()
320
    {
@@ 319-336 (lines=18) @@
316
           ), $data['sub']);
317
    }
318
319
    public function tesObjectMapping()
320
    {
321
        $transformer = $this->getTransformer();
322
        $document    = $transformer->transform(new POPO(), array(
323
                'sub' => array(
324
                    'type' => 'object',
325
                    'properties' => array('bar'),
326
                    ),
327
                ));
328
        $data        = $document->getData();
329
330
        $this->assertTrue(array_key_exists('sub', $data));
331
        $this->assertInternalType('array', $data['sub']);
332
        $this->assertEquals(array(
333
             array('bar' => 'foo'),
334
             array('bar' => 'bar'),
335
           ), $data['sub']);
336
    }
337
338
    public function testObjectDoesNotRequireProperties()
339
    {
@@ 442-462 (lines=21) @@
439
        $this->assertEquals('parent', $document->getParent());
440
    }
441
442
    public function testThatMappedObjectsDontNeedAnIdentifierField()
443
    {
444
        $transformer = $this->getTransformer();
445
        $document    = $transformer->transform(new POPO(), array(
446
            'objWithoutIdentifier' => array(
447
                'type' => 'object',
448
                'properties' => array(
449
                    'foo' => array(),
450
                    'bar' => array()
451
                )
452
            ),
453
        ));
454
        $data        = $document->getData();
455
456
        $this->assertTrue(array_key_exists('objWithoutIdentifier', $data));
457
        $this->assertInternalType('array', $data['objWithoutIdentifier']);
458
        $this->assertEquals(array(
459
            'foo' => 'foo',
460
            'bar' => 'foo'
461
        ), $data['objWithoutIdentifier']);
462
    }
463
464
    public function testThatNestedObjectsDontNeedAnIdentifierField()
465
    {