1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-11 16:49:42 +01:00

Merge pull request #1574 from kylekatarnls/fix/unit-test-windows-compatibility

Allow tests to pass even on Windows with git core.autocrlf on
This commit is contained in:
terrafrost 2021-01-12 10:27:40 -06:00 committed by GitHub
commit 6470c492c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,11 +19,11 @@ class Unit_Crypt_DHTest extends PhpseclibTestCase
{
$a = DH::createParameters('diffie-hellman-group1-sha1');
$a = str_replace("\r\n", "\n", trim($a));
$b = '-----BEGIN DH PARAMETERS-----
$b = str_replace("\r\n", "\n", '-----BEGIN DH PARAMETERS-----
MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR
Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL
/1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC
-----END DH PARAMETERS-----';
-----END DH PARAMETERS-----');
$this->assertSame($b, "$a");
}
@ -43,11 +43,11 @@ Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL
$base = new BigInteger(2);
$a = DH::createParameters($prime, $base);
$a = str_replace("\r\n", "\n", trim($a));
$b = '-----BEGIN DH PARAMETERS-----
$b = str_replace("\r\n", "\n", '-----BEGIN DH PARAMETERS-----
MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR
Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL
/1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC
-----END DH PARAMETERS-----';
-----END DH PARAMETERS-----');
$this->assertSame($b, "$a");
}