Tests for scoped injection (#12378)

Change-Id: I540094d63ee38b0179badfae85c609a980b453a7