I agree with @stof for another reason: decoupling testing from installing composer. That would allow to use this locally on your machine, independently of where composer is installed.