'AuthorsRepository'; $propertyMetadata->relationshipType = PropertyMetadata::RELATIONSHIP_MANY_HAS_ONE; // translator $this->entityMetadata->shouldReceive('getProperty')->once()->with('translator')->andReturn($property $this->model->shouldReceive('getRepository')->once()->with('AuthorsRepository')->andReturn($this-> $this->model->shouldReceive('getMapper')->once()->andReturn($this->mapper); $this->mapper->shouldReceive('getStorageReflection')->once()->andReturn($this->reflection); $this->reflection->shouldReceive('getStoragePrimaryKey')->once()->andReturn(['id']); $this->reflection->shouldReceive('convertEntityToStorageKey')->once()->with('translator')->andReturn( $this->mapper->shouldReceive('getTableName')->once()->andReturn('authors'); $this->mapper->shouldReceive('getRepository')->once()->andReturn($this->mapper); $this->mapper->shouldReceive('getEntityClassNames')->once()->andReturn(['EntityClass2']); $this->metadataStorage->shouldReceive('get')->once()->with('EntityClass2')->andReturn($this->entityM // name $this->entityMetadata->shouldReceive('getProperty')->once()->with('name'); $this->reflection->shouldReceive('convertEntityToStorageKey')->once()->with('name')->andReturn('nam $this->queryBuilder->shouldReceive('leftJoin')->once()->with('books', 'authors', 'authors', '[books.transl $this->queryBuilder->shouldReceive('addOrderBy')->once()->with('authors.name'); $this->builderHelper->processOrderByExpression('this->translator->name', ICollection::ASC, $this->qu