Issue #3229686 by Spokje, dww: Optimize logic in Kernel- and Functional-test of TaxonomyTermFilterDepthTest