Add tests for passphrase

Improving test coverage. See #1127