Neos\Flow\Tests\Functional\Persistence\Doctrine\Mapping\Driver\FlowAnnotationDriverTest::doctrineIndexByAnnotationIsObserved PHP Метод

doctrineIndexByAnnotationIsObserved() публичный Метод

The "indexBy" annotation of EntityWithIndexedRelation must be kept
    public function doctrineIndexByAnnotationIsObserved()
    {
        $classMetadata = new ClassMetadata(Fixtures\EntityWithIndexedRelation::class);
        $driver = $this->objectManager->get(FlowAnnotationDriver::class);
        $driver->loadMetadataForClass(Fixtures\EntityWithIndexedRelation::class, $classMetadata);
        /* The annotation should be available at ManyToMany relations */
        $relatedAssociationMapping = $classMetadata->getAssociationMapping('annotatedIdentitiesEntities');
        $this->assertArrayHasKey('indexBy', $relatedAssociationMapping);
        $this->assertEquals('author', $relatedAssociationMapping['indexBy']);
        /* The annotation should be available at OneToMany relations */
        $relatedAssociationMapping = $classMetadata->getAssociationMapping('relatedIndexEntities');
        $this->assertArrayHasKey('indexBy', $relatedAssociationMapping);
        $this->assertEquals('sorting', $relatedAssociationMapping['indexBy']);
    }