[Backport Unit Tests] Fix platform unit tests in core.
Merge pull request #1280 from brendan-lynch/5.0-Core

[Backport Unit Tests] Fix platform unit tests in core.