Count the changes in an array
MATL, 2 bytes
dz

Try it online! Or verify all test cases.
Explanation
     % Implicit input
d    % Consecutive differences
z    % Number of nonzeros
     % Implicit display