The exam scores will meet the 2 year UC Foreign Language requirement, however the UC’s recommend 3 years to be competitive.
Also during the UC application review, the # of a-g courses exceeding the minimums is a consideration and again to be competitive for the UC’s, you need to exceed these minimums.
The UC website recommends students to take the actual HS courses for grades and as noted by @skieurope, other colleges will want to see the actual coursework and the UC’s are no exception although they do offer this option.