Add unit tests for PharPackageTask.

Test openssl signatures in PharPackageTask.
Make the unit tests pass.

setSignatureAlgorithm() must be called last. If files are added to the phar
package after it has been called, Phar will try to recompute the signature,
but will fail because it does not remember the private key correctly.

Also, setSignatureAlgorithm()'s second argument does not accept OpenSSL
resources. The private key must be passed in its text form, which is obtained
by calling openssl_pkey_export().