Skip to content

Commit

Permalink
Reenable test
Browse files Browse the repository at this point in the history
  • Loading branch information
seba-aln committed Oct 16, 2023
1 parent 825a5d8 commit 4156f6d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/PubNub/CryptoModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,7 @@ public function parseInput(string | object $input): string
if (array_key_exists("pn_other", $input)) {
$input = $input["pn_other"];
} else {
if (is_array($input)) {
throw new PubNubResponseParsingException("Decryption error: message is not a string");
} else {
throw new PubNubResponseParsingException("Decryption error: pn_other object key missing");
}
throw new PubNubResponseParsingException("Decryption error: pn_other object key missing");
}
} elseif (!is_string($input)) {
throw new PubNubResponseParsingException("Decryption error: message is not a string or object");
Expand Down
6 changes: 4 additions & 2 deletions src/PubNub/Models/Consumer/History/PNHistoryItemResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace PubNub\Models\Consumer\History;

use PubNub\Exceptions\PubNubResponseParsingException;
use PubNub\PubNubCryptoCore;


class PNHistoryItemResult
{
/** @var any */
Expand Down Expand Up @@ -39,7 +39,9 @@ public function decrypt()
if (is_string($this->entry)) {
$this->entry = $this->crypto->decrypt($this->entry);
} elseif (is_array($this->entry) and key_exists('pn_other', $this->entry)) {
$this->entry['pn_other'] = $this->crypto->decrypt($this->entry['pn_other']);
$this->entry = $this->crypto->decrypt($this->entry['pn_other']);
} else {
throw new PubNubResponseParsingException("Decryption error: message is not a string");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ public function testCountReverseStartEndSuccess()

public function testProcessMessageError()
{
$this->markTestSkipped('must be revisited.');
$this->expectException(PubNubResponseParsingException::class);
$this->expectExceptionMessage("Decryption error: message is not a string");

Expand Down

0 comments on commit 4156f6d

Please sign in to comment.