Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Apply suggestions from styleci and rename two test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrosse committed Sep 15, 2015
1 parent c385ba6 commit 8455647
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lib/X509/CSR/CSR.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,42 @@ public function getVersion()
{
return self::CSR_VERSION_NR;
}

public function getOrganizationName()
{
return $this->subject->getOrganization();
}

public function getLocalName()
{
return $this->subject->getLocality();
}

public function getState()
{
return $this->subject->getState();
}

public function getCountry()
{
return $this->subject->getCountry();
}

public function getOrganizationalUnit()
{
return $this->subject->getOrganizationalUnit();
}

public function getPublicKey()
{
return $this->publicKey;
}

public function getSignature()
{
return $this->signature;
}

public function getSignatureAlgorithm()
{
return $this->signatureAlgorithm;
Expand Down
9 changes: 4 additions & 5 deletions tests/ASN1/ExplicitlyTaggedObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace FG\Test\ASN1;

use FG\ASN1\Identifier;
use FG\ASN1\Object;
use FG\Test\ASN1TestCase;
use FG\ASN1\ExplicitlyTaggedObject;
use FG\ASN1\Universal\PrintableString;
Expand Down Expand Up @@ -94,22 +93,22 @@ public function getTags()
* @expectedExceptionMessage ASN.1 Parser Exception at offset 2: Context-Specific explicitly tagged object [1] starting at offset 2 is shorter than required in the outer tag
* @depends testFromBinary
*/
public function testFromBinaryExTagObjWithInvalidOuterLengthThrowsException1()
public function testFromBinaryWithInvalidOuterLengthThrowsException1()
{
$data = hex2bin('a104040101');
// ^- this is wrong. correct would be "3"
Object::fromBinary($data);
ExplicitlyTaggedObject::fromBinary($data);
}

/**
* @expectedException \FG\ASN1\Exception\ParserException
* @expectedExceptionMessage ASN.1 Parser Exception at offset 2: Context-Specific explicitly tagged object [1] starting at offset 2 is longer than allowed in the outer tag
* @depends testFromBinary
*/
public function testFromBinaryExTagObjWithInvalidOuterLengthThrowsException2()
public function testFromBinaryWithInvalidOuterLengthThrowsException2()
{
$data = hex2bin('a102040101');
// ^- this is wrong. correct would be "3"
Object::fromBinary($data);
ExplicitlyTaggedObject::fromBinary($data);
}
}
1 change: 1 addition & 0 deletions tests/ASN1/Universal/SetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function testFromBinary()
/*
* @depends testFromBinary
*/

public function testFromBinaryWithOffset()
{
$originalObject1 = new Set(
Expand Down

0 comments on commit 8455647

Please sign in to comment.