Having consulted with some French compatriots living in France, we do agree that 'savoir' here is the instinctive verb we would use in both the examples you quote.
However, it is true that 'connaître' would be acceptable but 'savoir' is better perhaps because of the 'par cœur' which indicate that you know the text and the lesson for sure...
Sign in to submit your answer
Don't have an account yet? Join today
Test your French to the CEFR standard