Added test for collected hooks count

We have to test not only hooks order but also hooks count to make sure that collecting hooks works properly.