$profiler = new Profiler($logger);
$profiler->enable(false);
Expects that profiler is disabled, but it returns new disabled profiler instead, and old one still stays enabled.
I suggest to make enabled property mutable and switch it's value using method ->enable() instead of cloning profiler