From b85c3a5c0a06001452428bc5ea762525bb392be3 Mon Sep 17 00:00:00 2001 From: Bob Violier Date: Mon, 1 Feb 2016 09:47:06 +0100 Subject: [PATCH 1/4] Add missing details parameter to HLR object. --- src/MessageBird/Objects/Hlr.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MessageBird/Objects/Hlr.php b/src/MessageBird/Objects/Hlr.php index a46c96ef..f2ebf89b 100644 --- a/src/MessageBird/Objects/Hlr.php +++ b/src/MessageBird/Objects/Hlr.php @@ -43,6 +43,14 @@ class Hlr extends Base */ public $network; + /** + * A array with extra HLR information. Do note that the attributes in the array can change over time and + * can be null (not all information is availble for all countries and providers). + * + * @var array + */ + public $details; + /** * A client reference. Here you can put your own reference, * like your internal reference. From e322a3b85ab1ce74d5caee60d1993bb7a58f118f Mon Sep 17 00:00:00 2001 From: Bob Violier Date: Mon, 1 Feb 2016 09:53:07 +0100 Subject: [PATCH 2/4] Details should be an array + change test accordingly. --- src/MessageBird/Objects/Hlr.php | 2 +- tests/integration/hlr/HlrTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MessageBird/Objects/Hlr.php b/src/MessageBird/Objects/Hlr.php index f2ebf89b..e7b21a7a 100644 --- a/src/MessageBird/Objects/Hlr.php +++ b/src/MessageBird/Objects/Hlr.php @@ -49,7 +49,7 @@ class Hlr extends Base * * @var array */ - public $details; + public $details = []; /** * A client reference. Here you can put your own reference, diff --git a/tests/integration/hlr/HlrTest.php b/tests/integration/hlr/HlrTest.php index 26df96a8..d66744f7 100644 --- a/tests/integration/hlr/HlrTest.php +++ b/tests/integration/hlr/HlrTest.php @@ -16,7 +16,7 @@ public function testCreateHlr() $Hlr->msisdn = 'MessageBird'; $Hlr->reference = "yoloswag3000"; - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"reference":"yoloswag3000","status":null}'); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"details":[],"reference":"yoloswag3000","status":null}'); $this->client->hlr->create($Hlr); } From 9fe2d2d3ef9fafa9362fdcfdf51885e86a08872e Mon Sep 17 00:00:00 2001 From: Bob Violier Date: Mon, 1 Feb 2016 09:54:56 +0100 Subject: [PATCH 3/4] [] is not supported in PHP5.3 --- src/MessageBird/Objects/Hlr.php | 2 +- tests/integration/hlr/HlrTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MessageBird/Objects/Hlr.php b/src/MessageBird/Objects/Hlr.php index e7b21a7a..9338d030 100644 --- a/src/MessageBird/Objects/Hlr.php +++ b/src/MessageBird/Objects/Hlr.php @@ -49,7 +49,7 @@ class Hlr extends Base * * @var array */ - public $details = []; + public $details = array(); /** * A client reference. Here you can put your own reference, diff --git a/tests/integration/hlr/HlrTest.php b/tests/integration/hlr/HlrTest.php index d66744f7..9cc65085 100644 --- a/tests/integration/hlr/HlrTest.php +++ b/tests/integration/hlr/HlrTest.php @@ -16,7 +16,7 @@ public function testCreateHlr() $Hlr->msisdn = 'MessageBird'; $Hlr->reference = "yoloswag3000"; - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"details":[],"reference":"yoloswag3000","status":null}'); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"details":array(),"reference":"yoloswag3000","status":null}'); $this->client->hlr->create($Hlr); } From 67e51942f6354d3057695c21b32e45db2e713330 Mon Sep 17 00:00:00 2001 From: Bob Violier Date: Mon, 1 Feb 2016 11:07:08 +0100 Subject: [PATCH 4/4] Fix HLR test --- tests/integration/hlr/HlrTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/hlr/HlrTest.php b/tests/integration/hlr/HlrTest.php index 9cc65085..d66744f7 100644 --- a/tests/integration/hlr/HlrTest.php +++ b/tests/integration/hlr/HlrTest.php @@ -16,7 +16,7 @@ public function testCreateHlr() $Hlr->msisdn = 'MessageBird'; $Hlr->reference = "yoloswag3000"; - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"details":array(),"reference":"yoloswag3000","status":null}'); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'hlr', null, '{"msisdn":"MessageBird","network":null,"details":[],"reference":"yoloswag3000","status":null}'); $this->client->hlr->create($Hlr); }