Add unit test for getData

Having a unit test for `getData` would have caught the regression fixed in #4793, so this PR adds a basic test that just checks if `getData` succeeds.

As a follow-up we might also want to either modify, or add another test, to check that `getData` returns the correct data. In that case we should probably use a smaller PDF file to test with.