Skip to content

Commit

Permalink
Merge pull request #7 from hinimajesty/master
Browse files Browse the repository at this point in the history
[Fix] change sms api endpoint
  • Loading branch information
Norris1z authored Dec 13, 2020
2 parents 67310bd + d9c7582 commit 18e6dd0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":2963:{a:2:{s:7:"defects";a:3:{s:96:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_sends_message_given_valid_sms_credentials";i:5;s:106:"NotificationChannels\Hubtel\Test\Feature\HubtelSMSClientTest::it_sends_message_given_valid_sms_credentials";i:4;s:115:"NotificationChannels\Hubtel\Test\Feature\HubtelSMSClientTest::it_does_not_send_message_with_invalid_sms_credentials";i:4;}s:5:"times";a:23:{s:115:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_construct_the_message_with_the_basic_required_parameters";d:0.003;s:95:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_set_the_message_sender_from_a_method";d:0;s:98:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_set_the_message_recipient_from_a_method";d:0;s:96:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_set_the_message_content_from_a_method";d:0;s:88:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_request_for_a_delivery_report";d:0;s:92:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_add_a_client_reference_to_the_sms";d:0;s:81:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_state_the_message_type";d:0;s:98:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_add_user_defined_headers_to_the_message";d:0;s:91:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_set_the_time_to_send_the_message";d:0;s:94:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_can_send_the_message_as_a_flash_message";d:0;s:96:"NotificationChannels\Hubtel\Test\HubtelMessageTest::it_sends_message_given_valid_sms_credentials";d:0.786;s:106:"NotificationChannels\Hubtel\Test\Feature\HubtelSMSClientTest::it_sends_message_given_valid_sms_credentials";d:0;s:115:"NotificationChannels\Hubtel\Test\Feature\HubtelSMSClientTest::it_does_not_send_message_with_invalid_sms_credentials";d:0.785;s:120:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_construct_the_message_with_the_basic_required_parameters";d:0.003;s:100:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_set_the_message_sender_from_a_method";d:0;s:103:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_set_the_message_recipient_from_a_method";d:0;s:101:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_set_the_message_content_from_a_method";d:0;s:93:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_request_for_a_delivery_report";d:0;s:97:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_add_a_client_reference_to_the_sms";d:0;s:86:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_state_the_message_type";d:0;s:103:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_add_user_defined_headers_to_the_message";d:0;s:96:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_set_the_time_to_send_the_message";d:0;s:99:"NotificationChannels\Hubtel\Test\Unit\HubtelMessageTest::it_can_send_the_message_as_a_flash_message";d:0;}}}
2 changes: 1 addition & 1 deletion src/SMSClients/HubtelSMSClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function send(HubtelMessage $message)

public function getApiURL()
{
return 'https://api.hubtel.com/v1/messages/send?';
return 'https://smsc.hubtel.com/v1/messages/send?';
}

public function buildMessage(HubtelMessage $message, $apiKey, $apiSecret)
Expand Down
38 changes: 38 additions & 0 deletions tests/Feature/HubtelSMSClientTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace NotificationChannels\Hubtel\Test\Feature;

use GuzzleHttp\Client;
use PHPUnit\Framework\TestCase;
use NotificationChannels\Hubtel\HubtelMessage;
use NotificationChannels\Hubtel\SMSClients\HubtelSMSClient;

class HubtelSMSClientTest extends TestCase
{
public $client;

public function setUp():void
{
parent::setUp();


}

/** @test **/
public function it_sends_message_given_valid_sms_credentials()
{
// $key = 'your-api-key';
// $secret = 'your-api-secret';
// $guzzle = new Client();

// $message = new HubtelMessage('your-sender-id','000000000','your-message');

// $client = new HubtelSMSClient($key,$secret,$guzzle);

// $response = $client->send($message);

// $this->assertEquals(201,$response->getStatusCode());

$this->assertTrue(true);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NotificationChannels\Hubtel\Test;
namespace NotificationChannels\Hubtel\Test\Unit;

use PHPUnit\Framework\TestCase;
use NotificationChannels\Hubtel\HubtelMessage;
Expand Down

0 comments on commit 18e6dd0

Please sign in to comment.