Refactored tests

These tests are for #8930 - I've refactored tests so that similar ones use @dataProvider annotation and added cases in which issue problem does not appear.