Added tests for #8930

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8930
| License       | MIT
| Doc PR        | -

These tests are for #8930 - I've refactored tests so that similar ones use @dataProvider annotation. From my experience with the subject this issue happens neither in 2.3 nor in master.