diff --git a/src/messenger/tests/webim/libs/MibewAPITest.php b/src/messenger/tests/webim/libs/MibewAPITest.php index dc773b92..538ef97e 100644 --- a/src/messenger/tests/webim/libs/MibewAPITest.php +++ b/src/messenger/tests/webim/libs/MibewAPITest.php @@ -260,20 +260,6 @@ class MibewAPITest extends PHPUnit_Framework_TestCase { ); } - // Wrong package. Signature element is empty. - $wrong_package = array('signature' => ''); - - // Try to catch MibewAPIException with MibewAPIException::EMPTY_SIGNATURE code - try { - $api->checkPackage($wrong_package, $trusted_signatures); - $this->fail("Exception must be thrown"); - } catch (MibewAPIException $e) { - $this->assertEquals( - MibewAPIException::EMPTY_SIGNATURE, - $e->getCode() - ); - } - // Wrong package. Signature is wrong. $wrong_package = array('signature' => 'wrong_signature'); diff --git a/src/messenger/webim/libs/mibew_api.php b/src/messenger/webim/libs/mibew_api.php index a8c00573..e8dd8f3c 100644 --- a/src/messenger/webim/libs/mibew_api.php +++ b/src/messenger/webim/libs/mibew_api.php @@ -67,7 +67,7 @@ Class MibewAPI { */ public function checkPackage($package, $trusted_signatures) { // Check signature - if (empty($package['signature'])) { + if (! isset($package['signature'])) { throw new MibewAPIException( "Package signature is empty", MibewAPIException::EMPTY_SIGNATURE @@ -298,7 +298,7 @@ Class MibewAPI { MibewAPIException::RESULT_FUNCTION_ALREADY_EXISTS ); } - // Furst 'result' function found + // First 'result' function found $result_function = $function; } }