From 36761c82fec72c8cf3543f6b02f4e3a83ebdcc5b Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Wed, 17 Sep 2014 11:45:22 -0400 Subject: [PATCH] Working on more testing --- tests/Bitpay/BitauthTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Bitpay/BitauthTest.php b/tests/Bitpay/BitauthTest.php index 473c2be..cc6188a 100644 --- a/tests/Bitpay/BitauthTest.php +++ b/tests/Bitpay/BitauthTest.php @@ -57,4 +57,26 @@ class BitauthTest extends \PHPUnit_Framework_TestCase $this->assertSame($datum[2], $bitauth->encrypt($datum[0], $datum[1])); } } + + public function testSignature() + { + $bitauth = new Bitauth(); + $data = 'https://test.bitpay.com/tokens?nonce=200'; + $signature = $bitauth->sign($data, $this->getMockPrivateKey()); + //$this->assertSame( + // '03b8144d4943435474e40c0fb5eb8b58873671534232f08c2034d01a7210876d', + // $signature + //); + } + + private function getMockPrivateKey() + { + $key = $this->getMock('Bitpay\PrivateKey'); + + $key + ->method('getHex') + ->will($this->returnValue('private key hex value goes here')); + + return $key; + } }