Because your second option is also a choice, it must be enclosed in parentheses. Thus, your statement
$test='one'; echo $test == 'one' ? 'one' : $test == 'two' ? 'two' : 'three';
needs to be structured like this:
$test='one';
echo $test == 'one' ? 'one' : ($test == 'two' ? 'two' : 'three');