protected function withFileMapperFindByIdReturningFile($id = false) { if (!$id) { $id = $this->fileId; } $this->mockFileMapper->expects($this->once())->method('findById')->willReturn(new $this->fileEntityClass(['id' => $id])); }