Why does 考 precede 中文 in 我下个星期要考中文?
考 is the verb. 


  我 / 下个星期 / 要 / 考 / 中文
  I / next week / will / test / Chinese


If it helps, you could regard 考中文 here as a set construction meaning "to have a Chinese test". Same for 考数学 etc.