mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
Merge pull request #466 from bantu/asn1-handle-indef-lengths-tests-fixup
ASN1Test: Use assertSame and the correct parameter order. * bantu/asn1-handle-indef-lengths-tests-fixup: ASN1Test: Even better, use assertCount instead of assertSame. ASN1Test: The expected value comes first in assertEquals/assertSame. ASN1Test: Also check the type by using assertSame instead of assertEquals.
This commit is contained in:
commit
e8ccb7a995
@ -241,7 +241,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
|
|||||||
{
|
{
|
||||||
$asn1 = new File_ASN1();
|
$asn1 = new File_ASN1();
|
||||||
$decoded = $asn1->decodeBER(file_get_contents(dirname(__FILE__) . '/ASN1/FE.pdf.p7m'));
|
$decoded = $asn1->decodeBER(file_get_contents(dirname(__FILE__) . '/ASN1/FE.pdf.p7m'));
|
||||||
$this->assertEquals(count($decoded[0]['content'][1]['content'][0]['content']), 5); // older versions would have returned 3
|
$this->assertCount(5, $decoded[0]['content'][1]['content'][0]['content']); // older versions would have returned 3
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDefiniteLength()
|
public function testDefiniteLength()
|
||||||
@ -266,6 +266,6 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
|
|||||||
'IOkKcGQRCMha8X2e7GmlpdWC1ycenlbN0nbVeSv3JUMcafC4+Q==';
|
'IOkKcGQRCMha8X2e7GmlpdWC1ycenlbN0nbVeSv3JUMcafC4+Q==';
|
||||||
$asn1 = new File_ASN1();
|
$asn1 = new File_ASN1();
|
||||||
$decoded = $asn1->decodeBER(base64_decode($str));
|
$decoded = $asn1->decodeBER(base64_decode($str));
|
||||||
$this->assertEquals(count($decoded[0]['content']), 3);
|
$this->assertCount(3, $decoded[0]['content']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user