Skip to content

Commit

Permalink
Fix #24 failing tests (#25)
Browse files Browse the repository at this point in the history
* Add 8.0 support

Adds php 8.0 to php requirements

* Add .idea and .phpunit.result.cache

* Fix [#24](#24) failing test
  • Loading branch information
jwambugu committed Nov 13, 2021
1 parent cc61d34 commit ace7024
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
composer.lock
vendor
coverage
.idea
.phpunit.result.cache
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"minimum-stability": "dev",
"require": {
"php": "^7.1",
"php": "^7.1|^8.0",
"illuminate/support": "^5.0|^6.0|^7.0|^8.0"
},
"require-dev": {
Expand Down
9 changes: 8 additions & 1 deletion tests/Unit/MpesaB2CTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@

namespace Gathuku\Mpesa\Tests\Unit;

use Gathuku\Mpesa\Tests\BaseTest;
use Gathuku\Mpesa\Facades\Mpesa;
use Gathuku\Mpesa\Tests\BaseTest;

class MpesaB2CTest extends BaseTest
{
public function test_b2c()
{
$response = Mpesa::b2c(100, '254708374149', 'PromotionPayment', 'testing');
$data = json_decode($response, true);

$this->assertNotEmpty($data);

if (isset($data['errorCode'])) {
// throw new \Exception(sprintf('mpesa request failed with error code:%s - %s', $data['errorCode'], $data['errorMessage']));
return;
}
//$this->assertTrue($response);
$this->assertArrayHasKey(
'ConversationID',
Expand Down

0 comments on commit ace7024

Please sign in to comment.