Pop quizzes have always been included in the syllabus's grading rubric in every class I've ever taken that has them. The date of the quiz is the surprise, not the fact that it exists and will be part of your grade.
Pop quizzes should be used to give the teacher information about what the students are actually understanding vs not understanding, not to actually determine a student's grade in a class.
That’s not the kind of unexpected situation the comment you are replying to is referring to at all. If the rules are not set in advance, they are basically arbitrary.