diff --git a/test/unit/BitPayKeyUtils/KeyHelper/KeyTest.php b/test/unit/BitPayKeyUtils/KeyHelper/KeyTest.php index 501dbb9..88ef334 100644 --- a/test/unit/BitPayKeyUtils/KeyHelper/KeyTest.php +++ b/test/unit/BitPayKeyUtils/KeyHelper/KeyTest.php @@ -24,7 +24,7 @@ public function testGetIdWhenIdSet() $id = 'test'; $testedObject = $this->getTestedClass($id); $result = $testedObject->getId(); - $this->assertEquals($id, $result); + $this->assertSame($id, $result); } /** @@ -37,7 +37,7 @@ public function testGetHex() $this->setProtectedPropertyValue($testedObject, 'hex', $exampleValue); $result = $testedObject->getHex(); - $this->assertEquals($exampleValue, $result); + $this->assertSame($exampleValue, $result); } /** @@ -50,7 +50,7 @@ public function testGetDec() $this->setProtectedPropertyValue($testedObject, 'dec', $exampleValue); $result = $testedObject->getDec(); - $this->assertEquals($exampleValue, $result); + $this->assertSame($exampleValue, $result); } /** @@ -75,11 +75,11 @@ public function testUnserialize() $testedObject->unserialize($data); - $this->assertEquals('id', $testedObject->getId()); - $this->assertEquals('x', $testedObject->getX()); - $this->assertEquals('y', $testedObject->getY()); - $this->assertEquals('hex', $testedObject->getHex()); - $this->assertEquals('dec', $testedObject->getDec()); + $this->assertSame('id', $testedObject->getId()); + $this->assertSame('x', $testedObject->getX()); + $this->assertSame('y', $testedObject->getY()); + $this->assertSame('hex', $testedObject->getHex()); + $this->assertSame('dec', $testedObject->getDec()); } /** diff --git a/test/unit/BitPayKeyUtils/KeyHelper/PrivateKeyTest.php b/test/unit/BitPayKeyUtils/KeyHelper/PrivateKeyTest.php index 76776b1..119dad1 100644 --- a/test/unit/BitPayKeyUtils/KeyHelper/PrivateKeyTest.php +++ b/test/unit/BitPayKeyUtils/KeyHelper/PrivateKeyTest.php @@ -17,7 +17,7 @@ public function testSetHex() $testedObject->setHex( $exampleValue ); $realValue = $this->accessProtected( $testedObject, 'hex' ); - $this->assertEquals( $exampleValue, $realValue ); + $this->assertSame( $exampleValue, $realValue ); } /** @@ -42,7 +42,7 @@ public function testGenerateReturnsObjectWithHexIfHexIsSet() $testedObject->setHex( $expectedValue ); $result = $testedObject->generate(); $realValue = $this->accessProtected( $result, 'hex' ); - $this->assertEquals( $expectedValue, $realValue ); + $this->assertSame( $expectedValue, $realValue ); } public function testIsValidIfKeyNotSet() @@ -109,8 +109,8 @@ public function testPemDecode() $result = $testedObject->pemDecode( self::EXAMPLE_ECDSA_KEY ); $this->assertIsArray( $result ); - $this->assertEquals( '52f7b0b9e2a06703bc758cfc13e5370f7a04ec7528a728daab2ae14c21414a2c', $result[ 'private_key' ] ); - $this->assertEquals( + $this->assertSame( '52f7b0b9e2a06703bc758cfc13e5370f7a04ec7528a728daab2ae14c21414a2c', $result[ 'private_key' ] ); + $this->assertSame( '045ecd459aae1074f01b9f737271d114f873a3737916f5e7dbb28da423fbdd0d359c482324df5d2ce771b7b510a50c13cfbae240b0a8216cf7da4da52999714234', $result[ 'public_key' ] ); } @@ -177,7 +177,7 @@ public function test__toStringWhenHexIsSet() $testedObject = $this->createClassObject(); $testedObject->setHex( self::EXAMPLE_HEX_STRING ); - $this->assertEquals( self::EXAMPLE_HEX_STRING, (string) $testedObject ); + $this->assertSame( self::EXAMPLE_HEX_STRING, (string) $testedObject ); } public function testGetPublicKeyIfKeyIsNull() @@ -195,7 +195,7 @@ public function testGetPublicKeyIfKeyIsNotNull() $secondResult = $testedObject->getPublicKey(); $this->assertInstanceOf( PublicKey::class, $firstResult ); - $this->assertEquals( $firstResult, $secondResult ); + $this->assertSame( $firstResult, $secondResult ); } private function createClassObject(): PrivateKey diff --git a/test/unit/BitPayKeyUtils/KeyHelper/PublicKeyTest.php b/test/unit/BitPayKeyUtils/KeyHelper/PublicKeyTest.php index ca97fdb..2a355b1 100644 --- a/test/unit/BitPayKeyUtils/KeyHelper/PublicKeyTest.php +++ b/test/unit/BitPayKeyUtils/KeyHelper/PublicKeyTest.php @@ -27,13 +27,13 @@ public function testSetPrivateKey() $testedObject = $this->getTestedClassObject(); $testedObject->setPrivateKey($privateKeyMock); - $this->assertEquals($privateKeyMock, $this->accessProtected($testedObject, 'privateKey')); + $this->assertSame($privateKeyMock, $this->accessProtected($testedObject, 'privateKey')); } public function testToStringWhenXIsNull() { $testedObject = $this->getTestedClassObject(); - $this->assertEquals('', (string)$testedObject); + $this->assertSame('', (string)$testedObject); } /** @@ -47,7 +47,7 @@ public function testToStringWhenXIsNotNullAndMathModIs1() $this->setProtectedPropertyValue($testedObject, 'y', 1); $toStringCompressionResult = '031'; - $this->assertEquals($toStringCompressionResult, (string)$testedObject); + $this->assertSame($toStringCompressionResult, (string)$testedObject); } /** @@ -61,7 +61,7 @@ public function testToStringWhenXIsNotNullAndMathModIsNot1() $this->setProtectedPropertyValue($testedObject, 'y', 4); $toStringCompressionResult = '021'; - $this->assertEquals($toStringCompressionResult, (string)$testedObject); + $this->assertSame($toStringCompressionResult, (string)$testedObject); } public function testIsValidWhenPublicKeyIsBlank() diff --git a/test/unit/BitPayKeyUtils/KeyHelper/SinKeyTest.php b/test/unit/BitPayKeyUtils/KeyHelper/SinKeyTest.php index 5ad2975..a78482e 100644 --- a/test/unit/BitPayKeyUtils/KeyHelper/SinKeyTest.php +++ b/test/unit/BitPayKeyUtils/KeyHelper/SinKeyTest.php @@ -33,14 +33,14 @@ public function test__toStringValue(): void $property = $this->getAccessibleProperty(SinKey::class, 'value'); $value = $property->getValue($this->sinKey); - $this->assertEquals($value, $this->sinKey->__toString()); + $this->assertSame($value, $this->sinKey->__toString()); } public function testSetPublicKey(): void { $publicKey = $this->getMockBuilder(PublicKey::class)->getMock(); - $this->assertEquals($this->sinKey, $this->sinKey->setPublicKey($publicKey)); + $this->assertSame($this->sinKey, $this->sinKey->setPublicKey($publicKey)); } public function testGenerateWithoutPublicKey(): void @@ -65,12 +65,12 @@ public function testIsValid(): void $this->sinKey->setPublicKey($publicKey); $this->sinKey->generate(); - $this->assertEquals(true, $this->sinKey->isValid()); + $this->assertSame(true, $this->sinKey->isValid()); } public function testIsValidFalse(): void { - $this->assertEquals(false, $this->sinKey->isValid()); + $this->assertSame(false, $this->sinKey->isValid()); } private function getAccessibleProperty(string $class, string $property): ReflectionProperty diff --git a/test/unit/BitPayKeyUtils/Math/BcEngineTest.php b/test/unit/BitPayKeyUtils/Math/BcEngineTest.php index 0f5da68..4d99886 100644 --- a/test/unit/BitPayKeyUtils/Math/BcEngineTest.php +++ b/test/unit/BitPayKeyUtils/Math/BcEngineTest.php @@ -16,7 +16,7 @@ public function testAdd() $expectedValue = '12'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->add('5', '7')); + $this->assertSame($expectedValue, $bcEngine->add('5', '7')); } public function testInput() @@ -24,7 +24,7 @@ public function testInput() $expectedValue = '5'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->input($expectedValue)); + $this->assertSame($expectedValue, $bcEngine->input($expectedValue)); } public function testInputNull() @@ -32,7 +32,7 @@ public function testInputNull() $expectedValue = '0'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->input(null)); + $this->assertSame($expectedValue, $bcEngine->input(null)); } public function testInputHex() @@ -40,7 +40,7 @@ public function testInputHex() $expectedValue = '86'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->input('0x56')); + $this->assertSame($expectedValue, $bcEngine->input('0x56')); } public function testInputException() @@ -53,26 +53,26 @@ public function testInputException() public function testCmpGreaterThan() { - $expectedValue = '1'; + $expectedValue = 1; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->cmp('9', '7')); + $this->assertSame($expectedValue, $bcEngine->cmp('9', '7')); } public function testCmpLessThan() { - $expectedValue = '-1'; + $expectedValue = -1; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->cmp('7', '9')); + $this->assertSame($expectedValue, $bcEngine->cmp('7', '9')); } public function testCmpEqualsTo() { - $expectedValue = '0'; + $expectedValue = 0; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->cmp('7', '7')); + $this->assertSame($expectedValue, $bcEngine->cmp('7', '7')); } public function testDiv() @@ -80,7 +80,7 @@ public function testDiv() $expectedValue = '3'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->div('6', '2')); + $this->assertSame($expectedValue, $bcEngine->div('6', '2')); } public function testInvertm() @@ -88,7 +88,7 @@ public function testInvertm() $expectedValue = '0'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->invertm('6', '2')); + $this->assertSame($expectedValue, $bcEngine->invertm('6', '2')); } public function testInvertm2() @@ -96,7 +96,7 @@ public function testInvertm2() $expectedValue = '1'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->invertm('-1', '2')); + $this->assertSame($expectedValue, $bcEngine->invertm('-1', '2')); } public function testMod() @@ -104,7 +104,7 @@ public function testMod() $expectedValue = '0'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->mod('6', '2')); + $this->assertSame($expectedValue, $bcEngine->mod('6', '2')); } public function testMod2() @@ -112,7 +112,7 @@ public function testMod2() $expectedValue = '2'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->mod('-6', '2')); + $this->assertSame($expectedValue, $bcEngine->mod('-6', '2')); } public function testMul() @@ -120,7 +120,7 @@ public function testMul() $expectedValue = '21'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->mul('3', '7')); + $this->assertSame($expectedValue, $bcEngine->mul('3', '7')); } public function testPow() @@ -128,7 +128,7 @@ public function testPow() $expectedValue = '64'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->pow('4', '3')); + $this->assertSame($expectedValue, $bcEngine->pow('4', '3')); } public function testSub() @@ -136,7 +136,7 @@ public function testSub() $expectedValue = '18'; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->sub('20', '2')); + $this->assertSame($expectedValue, $bcEngine->sub('20', '2')); } public function testCoprime() @@ -144,7 +144,7 @@ public function testCoprime() $expectedValue = false; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->coprime('20', '2')); + $this->assertSame($expectedValue, $bcEngine->coprime('20', '2')); } public function testCoprime2() @@ -152,7 +152,7 @@ public function testCoprime2() $expectedValue = true; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->coprime('5', '3')); + $this->assertSame($expectedValue, $bcEngine->coprime('5', '3')); } public function testCoprime3() @@ -160,7 +160,7 @@ public function testCoprime3() $expectedValue = true; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->coprime('3', '5')); + $this->assertSame($expectedValue, $bcEngine->coprime('3', '5')); } public function testCoprime4() @@ -168,7 +168,7 @@ public function testCoprime4() $expectedValue = false; $bcEngine = $this->createClassObject(); - $this->assertEquals($expectedValue, $bcEngine->coprime('3', '3')); + $this->assertSame($expectedValue, $bcEngine->coprime('3', '3')); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Math/GmpEngineTest.php b/test/unit/BitPayKeyUtils/Math/GmpEngineTest.php index 06a2ce4..f6a5d25 100644 --- a/test/unit/BitPayKeyUtils/Math/GmpEngineTest.php +++ b/test/unit/BitPayKeyUtils/Math/GmpEngineTest.php @@ -12,7 +12,7 @@ public function testAdd() $actualResult = $gmp->add('2', '3'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testCmpGreaterThan() @@ -22,7 +22,7 @@ public function testCmpGreaterThan() $actualResult = $gmp->cmp('1234', '1000'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testCmpLessThan() @@ -32,7 +32,7 @@ public function testCmpLessThan() $actualResult = $gmp->cmp('1000', '1234'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testCmpEqualTo() @@ -42,7 +42,7 @@ public function testCmpEqualTo() $actualResult = $gmp->cmp('1000', '1000'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testDiv() @@ -52,7 +52,7 @@ public function testDiv() $actualResult = $gmp->div('10', '5'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testInvertm() @@ -62,7 +62,7 @@ public function testInvertm() $actualResult = $gmp->invertm('5', '11'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testMod() @@ -72,7 +72,7 @@ public function testMod() $actualResult = $gmp->mod('7', '4'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testMul() @@ -82,7 +82,7 @@ public function testMul() $actualResult = $gmp->mul('8', '2'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testPow() @@ -92,7 +92,7 @@ public function testPow() $actualResult = $gmp->pow('3', '3'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } public function testSub() @@ -102,7 +102,7 @@ public function testSub() $actualResult = $gmp->sub('64', '22'); $this->assertIsString($actualResult); - $this->assertEquals($expectedResult, $actualResult); + $this->assertSame($expectedResult, $actualResult); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Math/MathTest.php b/test/unit/BitPayKeyUtils/Math/MathTest.php index 3b48c2c..6622005 100644 --- a/test/unit/BitPayKeyUtils/Math/MathTest.php +++ b/test/unit/BitPayKeyUtils/Math/MathTest.php @@ -18,7 +18,7 @@ public function testGetEngine() $math = $this->createClassObject(); $math::setEngine($expectedEngine); - $this->assertEquals($expectedEngine, $math::getEngine()); + $this->assertSame($expectedEngine, $math::getEngine()); } public function testGetEngineName() @@ -27,7 +27,7 @@ public function testGetEngineName() $math = $this->createClassObject(); $math::setEngineName($expectedEngineName); - $this->assertEquals($expectedEngineName, $math::getEngineName()); + $this->assertSame($expectedEngineName, $math::getEngineName()); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Storage/EncryptedFilesystemStorageTest.php b/test/unit/BitPayKeyUtils/Storage/EncryptedFilesystemStorageTest.php index 8547e4e..a905e06 100644 --- a/test/unit/BitPayKeyUtils/Storage/EncryptedFilesystemStorageTest.php +++ b/test/unit/BitPayKeyUtils/Storage/EncryptedFilesystemStorageTest.php @@ -18,7 +18,7 @@ public function testPersist() $keyInterface = $this->getMockBuilder(Key::class)->getMock(); $keyInterface->method('getId')->willReturn(__DIR__ . '/test11.txt'); $this->assertFileExists(__DIR__ . '/test11.txt'); - $this->assertEquals(null, $encryptedFilesystemStorage->persist($keyInterface)); + $this->assertSame(null, $encryptedFilesystemStorage->persist($keyInterface)); } diff --git a/test/unit/BitPayKeyUtils/Storage/FilesystemStorageTest.php b/test/unit/BitPayKeyUtils/Storage/FilesystemStorageTest.php index 7aec66b..7f7fdf9 100644 --- a/test/unit/BitPayKeyUtils/Storage/FilesystemStorageTest.php +++ b/test/unit/BitPayKeyUtils/Storage/FilesystemStorageTest.php @@ -20,7 +20,7 @@ public function testPersist() $keyInterface->method('getId')->willReturn(__DIR__ . '/test1.txt'); $this->assertFileExists(__DIR__ . '/test1.txt'); @chmod(__DIR__ . 'test1.txt', 0777); - $this->assertEquals(null, $filesystemStorage->persist($keyInterface)); + $this->assertSame(null, $filesystemStorage->persist($keyInterface)); } public function testLoadNotFindException() @@ -49,7 +49,7 @@ public function testLoad() $expectedArray = ['Red', 'Green', 'Blue']; $filesystemStorage = $this->createClassObject(); - $this->assertEquals($expectedArray, $filesystemStorage->load(__DIR__ . '/test4.txt')); + $this->assertSame($expectedArray, $filesystemStorage->load(__DIR__ . '/test4.txt')); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Storage/test1.txt b/test/unit/BitPayKeyUtils/Storage/test1.txt index 6b6e7b3..46f07be 100755 --- a/test/unit/BitPayKeyUtils/Storage/test1.txt +++ b/test/unit/BitPayKeyUtils/Storage/test1.txt @@ -1 +1 @@ -O:17:"Mock_Key_7dd5a46d":0:{} \ No newline at end of file +O:17:"Mock_Key_c1e4b2bf":0:{} \ No newline at end of file diff --git a/test/unit/BitPayKeyUtils/Storage/test11.txt b/test/unit/BitPayKeyUtils/Storage/test11.txt index 4068866..92c1ed0 100644 --- a/test/unit/BitPayKeyUtils/Storage/test11.txt +++ b/test/unit/BitPayKeyUtils/Storage/test11.txt @@ -1 +1 @@ -c31eda5dd0eb0a1f93800db68d1ae0fd60daae108ae31cc034711b4a0e7bcebe \ No newline at end of file +a2c2ae8c5cd35cc02dfeef6309593cfe0ddcd995e6de235a033c889bc2c23299 \ No newline at end of file diff --git a/test/unit/BitPayKeyUtils/Util/Base58Test.php b/test/unit/BitPayKeyUtils/Util/Base58Test.php index 9df0604..5290f9f 100644 --- a/test/unit/BitPayKeyUtils/Util/Base58Test.php +++ b/test/unit/BitPayKeyUtils/Util/Base58Test.php @@ -23,31 +23,31 @@ public function testEncodeException() public function testEncode() { $base58 = $this->createClassObject(); - $this->assertEquals('P', $base58->encode('0x16')); + $this->assertSame('P', $base58->encode('0x16')); } public function testEncode2() { $base58 = $this->createClassObject(); - $this->assertEquals('1', $base58->encode('00')); + $this->assertSame('1', $base58->encode('00')); } public function testDecode() { $base58 = $this->createClassObject(); - $this->assertEquals('4f59cb', $base58->decode('Test')); + $this->assertSame('4f59cb', $base58->decode('Test')); } public function testDecode2() { $base58 = $this->createClassObject(); - $this->assertEquals('02bf547c6d249ea9', $base58->decode('Test 5 T 2')); + $this->assertSame('02bf547c6d249ea9', $base58->decode('Test 5 T 2')); } public function testDecode3() { $base58 = $this->createClassObject(); - $this->assertEquals('00', $base58->decode('1')); + $this->assertSame('00', $base58->decode('1')); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Util/ErrorTest.php b/test/unit/BitPayKeyUtils/Util/ErrorTest.php index ae3ddb9..bf12ae4 100644 --- a/test/unit/BitPayKeyUtils/Util/ErrorTest.php +++ b/test/unit/BitPayKeyUtils/Util/ErrorTest.php @@ -10,7 +10,7 @@ public function testBacktraceWhenPrintIsFalse() { $testedObject = $this->getTestedClassObject(); $result = $testedObject->backtrace(); - $this->assertEquals('backtrace', $result[0]['function']); + $this->assertSame('backtrace', $result[0]['function']); } public function testBacktraceWhenPrintIsTrue() @@ -47,7 +47,7 @@ public function testReportingWithNoParam() { $testedObject = $this->getTestedClassObject(); $result = $testedObject->reporting(); - $this->assertEquals(error_reporting(), $result); + $this->assertSame(error_reporting(), $result); } public function testReportingWithLevel() @@ -56,7 +56,7 @@ public function testReportingWithLevel() $exampleReportingLevel = 32767; $testedObject->reporting($exampleReportingLevel); $currentLevel = error_reporting(); - $this->assertEquals($exampleReportingLevel, $currentLevel); + $this->assertSame($exampleReportingLevel, $currentLevel); } public function testHandlerWithNoParams() diff --git a/test/unit/BitPayKeyUtils/Util/FingerprintTest.php b/test/unit/BitPayKeyUtils/Util/FingerprintTest.php index 71ac4cc..9b02f5a 100644 --- a/test/unit/BitPayKeyUtils/Util/FingerprintTest.php +++ b/test/unit/BitPayKeyUtils/Util/FingerprintTest.php @@ -23,6 +23,6 @@ public function testGenerateIssetFinHash() $actualValue = $fingerprint::generate(); $this->assertIsString($actualValue); - $this->assertEquals($expectedValue, $actualValue); + $this->assertSame($expectedValue, $actualValue); } } diff --git a/test/unit/BitPayKeyUtils/Util/PointTest.php b/test/unit/BitPayKeyUtils/Util/PointTest.php index c5ebf02..724c377 100644 --- a/test/unit/BitPayKeyUtils/Util/PointTest.php +++ b/test/unit/BitPayKeyUtils/Util/PointTest.php @@ -13,13 +13,13 @@ public function testInstanceOf(){ public function test__toString() { $point = new Point('3', '2'); - $this->assertEquals('(3, 2)', $point->__toString()); + $this->assertSame('(3, 2)', $point->__toString()); } public function test__toStringInfinite() { $point = new Point('inf', '2'); - $this->assertEquals('inf', $point->__toString()); + $this->assertSame('inf', $point->__toString()); } public function testIsInfinityFalse() @@ -37,13 +37,13 @@ public function testIsInfinityTrue() public function testGetX() { $point = $this->createClassObject(); - $this->assertEquals('-2', $point->getX()); + $this->assertSame('-2', $point->getX()); } public function testGetY() { $point = $this->createClassObject(); - $this->assertEquals('3', $point->getY()); + $this->assertSame('3', $point->getY()); } public function testSerialize() @@ -51,7 +51,7 @@ public function testSerialize() $expectedValue = 'a:2:{i:0;s:2:"-2";i:1;s:1:"3";}'; $point = $this->createClassObject(); - $this->assertEquals($expectedValue, $point->serialize()); + $this->assertSame($expectedValue, $point->serialize()); } public function testUnserialize() @@ -60,7 +60,7 @@ public function testUnserialize() $testedData = 'a:2:{i:0;s:2:"-2";i:1;s:1:"3";}'; $point = $this->createClassObject(); - $this->assertEquals(null, $point->unserialize($testedData)); + $this->assertSame(null, $point->unserialize($testedData)); } public function test__serialize() @@ -68,7 +68,7 @@ public function test__serialize() $expectedValue = ['-2', '3']; $point = $this->createClassObject(); - $this->assertEquals($expectedValue, $point->__serialize()); + $this->assertSame($expectedValue, $point->__serialize()); } public function test__unserialize() @@ -76,7 +76,7 @@ public function test__unserialize() $expectedValue = ['-2', '3']; $point = $this->createClassObject(); - $this->assertEquals(null, $point->__unserialize(['-2', '3'])); + $this->assertSame(null, $point->__unserialize(['-2', '3'])); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Util/Secp256k1Test.php b/test/unit/BitPayKeyUtils/Util/Secp256k1Test.php index 68de014..a9d1d5c 100644 --- a/test/unit/BitPayKeyUtils/Util/Secp256k1Test.php +++ b/test/unit/BitPayKeyUtils/Util/Secp256k1Test.php @@ -16,7 +16,7 @@ public function testAHex() $expectedValue = '0x00'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->aHex()); + $this->assertSame($expectedValue, $secp256k1->aHex()); } public function testBHex() @@ -24,7 +24,7 @@ public function testBHex() $expectedValue = '0x07'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->bHex()); + $this->assertSame($expectedValue, $secp256k1->bHex()); } public function testGHex() @@ -32,7 +32,7 @@ public function testGHex() $expectedValue = '0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->gHex()); + $this->assertSame($expectedValue, $secp256k1->gHex()); } public function testGxHex() @@ -40,7 +40,7 @@ public function testGxHex() $expectedValue = '0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->gxHex()); + $this->assertSame($expectedValue, $secp256k1->gxHex()); } public function testGyHex() @@ -48,7 +48,7 @@ public function testGyHex() $expectedValue = '0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->gyHex()); + $this->assertSame($expectedValue, $secp256k1->gyHex()); } public function testHHex() @@ -56,7 +56,7 @@ public function testHHex() $expectedValue = '0x01'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->hHex()); + $this->assertSame($expectedValue, $secp256k1->hHex()); } public function testNHex() @@ -64,7 +64,7 @@ public function testNHex() $expectedValue = '0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->nHex()); + $this->assertSame($expectedValue, $secp256k1->nHex()); } public function testPHex() @@ -72,7 +72,7 @@ public function testPHex() $expectedValue = '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'; $secp256k1 = $this->createClassObject(); - $this->assertEquals($expectedValue, $secp256k1->pHex()); + $this->assertSame($expectedValue, $secp256k1->pHex()); } private function createClassObject() diff --git a/test/unit/BitPayKeyUtils/Util/UtilTest.php b/test/unit/BitPayKeyUtils/Util/UtilTest.php index 6f526e3..3f5e1e7 100644 --- a/test/unit/BitPayKeyUtils/Util/UtilTest.php +++ b/test/unit/BitPayKeyUtils/Util/UtilTest.php @@ -17,7 +17,7 @@ public function testSha512() $expectedValue = 'ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::sha512('test')); + $this->assertSame($expectedValue, $util::sha512('test')); } public function testSha512hmac() @@ -25,7 +25,7 @@ public function testSha512hmac() $expectedValue = '287a0fb89a7fbdfa5b5538636918e537a5b83065e4ff331268b7aaa115dde047a9b0f4fb5b828608fc0b6327f10055f7637b058e9e0dbb9e698901a3e6dd461c'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::sha512hmac('test', 'key')); + $this->assertSame($expectedValue, $util::sha512hmac('test', 'key')); } public function testSha256ripe160() @@ -33,7 +33,7 @@ public function testSha256ripe160() $expectedValue = 'cebaa98c19807134434d107b0d3e5692a516ea66'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::sha256ripe160('test')); + $this->assertSame($expectedValue, $util::sha256ripe160('test')); } public function testRipe160() @@ -41,7 +41,7 @@ public function testRipe160() $expectedValue = '5e52fee47e6b070565f74372468cdc699de89107'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::ripe160('test')); + $this->assertSame($expectedValue, $util::ripe160('test')); } public function testSha256() @@ -49,7 +49,7 @@ public function testSha256() $expectedValue = '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::sha256('test')); + $this->assertSame($expectedValue, $util::sha256('test')); } public function testTwoSha256() @@ -57,7 +57,7 @@ public function testTwoSha256() $expectedValue = '7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::twoSha256('test')); + $this->assertSame($expectedValue, $util::twoSha256('test')); } public function testNonce() @@ -85,7 +85,7 @@ public function testEncodeHex1() $expectedValue = '7b'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::encodeHex('-123')); + $this->assertSame($expectedValue, $util::encodeHex('-123')); } public function testEncodeHex2() @@ -93,7 +93,7 @@ public function testEncodeHex2() $expectedValue = '1c2'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::encodeHex('450')); + $this->assertSame($expectedValue, $util::encodeHex('450')); } public function testDecToBin() @@ -101,7 +101,7 @@ public function testDecToBin() $expectedValue = '0011111'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::decToBin('124')); + $this->assertSame($expectedValue, $util::decToBin('124')); } public function testDecodeHex() @@ -109,7 +109,7 @@ public function testDecodeHex() $expectedValue = '257'; $util = $this->createClassObject(); - $this->assertEquals($expectedValue, $util::decodeHex('00101')); + $this->assertSame($expectedValue, $util::decodeHex('00101')); } public function testPointDouble() @@ -121,8 +121,8 @@ public function testPointDouble() $util = $this->createClassObject(); $point = $util::pointDouble($pointInterface); $this->assertIsObject($point); - $this->assertEquals('28948022309329048855892746252171976963317496166410141009864396001977208668062', $point->getX()); - $this->assertEquals('43422033463993573283839119378257965444976244249615211514796594002965813000105', $point->getY()); + $this->assertSame('28948022309329048855892746252171976963317496166410141009864396001977208668062', $point->getX()); + $this->assertSame('43422033463993573283839119378257965444976244249615211514796594002965813000105', $point->getY()); } public function testPointAdd() @@ -138,8 +138,8 @@ public function testPointAdd() $util = $this->createClassObject(); $point = $util::pointAdd($pointInterfaceP, $pointInterfaceQ); $this->assertIsObject($point); - $this->assertEquals('28948022309329048855892746252171976963317496166410141009864396001977208667914', $point->getX()); - $this->assertEquals('101318078082651670995624611882601919371611236582435493534525386006920230337669', $point->getY()); + $this->assertSame('28948022309329048855892746252171976963317496166410141009864396001977208667914', $point->getX()); + $this->assertSame('101318078082651670995624611882601919371611236582435493534525386006920230337669', $point->getY()); } public function testPointAddSameValues() @@ -155,8 +155,8 @@ public function testPointAddSameValues() $util = $this->createClassObject(); $point = $util::pointAdd($pointInterfaceP, $pointInterfaceQ); $this->assertIsObject($point); - $this->assertEquals('28948022309329048855892746252171976963317496166410141009864396001977208668062', $point->getX()); - $this->assertEquals('43422033463993573283839119378257965444976244249615211514796594002965813000105', $point->getY()); + $this->assertSame('28948022309329048855892746252171976963317496166410141009864396001977208668062', $point->getX()); + $this->assertSame('43422033463993573283839119378257965444976244249615211514796594002965813000105', $point->getY()); } public function testPointAddInfinity() @@ -172,8 +172,8 @@ public function testPointAddInfinity() $util = $this->createClassObject(); $point = $util::pointAdd($pointInterfaceP, $pointInterfaceQ); $this->assertIsObject($point); - $this->assertEquals('1', $point->getX()); - $this->assertEquals('2', $point->getY()); + $this->assertSame('1', $point->getX()); + $this->assertSame('2', $point->getY()); } public function testBinConv()