Skip to content

Commit

Permalink
Added request test. #67
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Nov 9, 2017
1 parent e68d133 commit d8037f5
Show file tree
Hide file tree
Showing 4 changed files with 510 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Model/Generated/Object/NotificationUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use bunq\Model\Generated\Endpoint\MonetaryAccountBank;
use bunq\Model\Generated\Endpoint\Payment;
use bunq\Model\Generated\Endpoint\PaymentBatch;
use bunq\Model\Generated\Endpoint\RequestInquiry;
use bunq\Model\Generated\Endpoint\RequestResponse;
use bunq\Model\Generated\Object\NotificationUrl;
use bunq\test\BunqSdkTestBase;
use bunq\Util\FileUtil;
Expand All @@ -31,6 +33,8 @@ class NotificationUrlTest extends BunqSdkTestBase
const GET_MASTER_CARD_ACTION = 'getMasterCardAction';
const GET_MONETARY_ACCOUNT_BANK = 'getMonetaryAccountBank';
const GET_PAYMENT_BATCH = 'getPaymentBatch';
const GET_REQUEST_INQUIRY = 'getRequestInquiry';
const GET_REQUEST_RESPONSE = 'getRequestResponse';

/**
* Assertion errors.
Expand All @@ -51,6 +55,8 @@ class NotificationUrlTest extends BunqSdkTestBase
const JSON_PATH_MASTER_CARD_ACTION_MODEL = self::BASE_PATH_JSON_MODEL . '/MasterCardAction.json';
const JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL = self::BASE_PATH_JSON_MODEL . '/MonetaryAccountBank.json';
const JSON_PATH_PAYMENT_BATCH_MODEL = self::BASE_PATH_JSON_MODEL . '/PaymentBatch.json';
const JSON_PATH_REQUEST_INQUIRY_MODEL = self::BASE_PATH_JSON_MODEL . '/RequestInquiry.json';
const JSON_PATH_REQUEST_RESPONSE_MODEL = self::BASE_PATH_JSON_MODEL . '/RequestResponse.json';

/**
* Model root key.
Expand Down Expand Up @@ -111,6 +117,28 @@ public function testPaymentBatchModel()
self::GET_PAYMENT_BATCH
);
}

/**
*/
public function testRequestResponse()
{
$this->executeTest(
self::JSON_PATH_REQUEST_RESPONSE_MODEL,
RequestResponse::class,
self::GET_REQUEST_RESPONSE
);
}

/**
*/
public function testRequestInquiryModel()
{
$this->executeTest(
self::JSON_PATH_REQUEST_INQUIRY_MODEL,
RequestInquiry::class,
self::GET_REQUEST_INQUIRY
);
}
public function testMasterCardAction()
{
$this->executeTest(
Expand Down
247 changes: 247 additions & 0 deletions tests/resource/NotificationUrlJsons/PaymentBatch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
{
"NotificationUrl": {
"target_url": "nope",
"category": "PAYMENT",
"event_type": "PAYMENT_BATCH_CREATED",
"object": {
"PaymentBatch": {
"id": 1,
"created": "2017-07-13 01:57:39.399256",
"updated": "2017-07-13 01:57:39.399256",
"payments": [
{
"id": 108864,
"created": "2017-11-08 11:20:03.950184",
"updated": "2017-11-08 11:20:03.950184",
"monetary_account_id": 213,
"amount": {
"currency": "EUR",
"value": "-24.95"
},
"description": "73d6df4a 680498 Your order #1234567",
"type": "IDEAL",
"merchant_reference": null,
"maturity_date": "2017-11-08",
"alias": {
"iban": "NL86BUNQ2025105541",
"is_light": false,
"display_name": "D. Howard",
"avatar": {
"uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec",
"image": [
{
"attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42",
"height": 1023,
"width": 1024,
"content_type": "image\/png"
}
],
"anchor_uuid": null
},
"label_user": {
"uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1",
"display_name": "D. Howard",
"country": "NL",
"avatar": {
"uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc",
"image": [
{
"attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980",
"height": 456,
"width": 456,
"content_type": "image\/jpeg"
}
],
"anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1"
},
"public_nick_name": "Dominic (nick) premium \u2728"
},
"country": "NL"
},
"counterparty_alias": {
"iban": null,
"is_light": null,
"display_name": "BoekenGigant",
"label_user": {
"uuid": null,
"display_name": "BoekenGigant",
"country": "NL",
"avatar": null,
"public_nick_name": "BoekenGigant"
},
"avatar": null,
"country": "NL"
},
"attachment": [],
"geolocation": {
"latitude": 52.387862883215,
"longitude": 4.8333778222355,
"altitude": 0,
"radius": 65
},
"batch_id": null,
"conversation": null,
"allow_chat": true,
"scheduled_id": null,
"address_billing": null,
"address_shipping": null
},
{
"id": 108864,
"created": "2017-11-08 11:20:03.950184",
"updated": "2017-11-08 11:20:03.950184",
"monetary_account_id": 213,
"amount": {
"currency": "EUR",
"value": "-24.95"
},
"description": "73d6df4a 680498 Your order #1234567",
"type": "IDEAL",
"merchant_reference": null,
"maturity_date": "2017-11-08",
"alias": {
"iban": "NL86BUNQ2025105541",
"is_light": false,
"display_name": "D. Howard",
"avatar": {
"uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec",
"image": [
{
"attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42",
"height": 1023,
"width": 1024,
"content_type": "image\/png"
}
],
"anchor_uuid": null
},
"label_user": {
"uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1",
"display_name": "D. Howard",
"country": "NL",
"avatar": {
"uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc",
"image": [
{
"attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980",
"height": 456,
"width": 456,
"content_type": "image\/jpeg"
}
],
"anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1"
},
"public_nick_name": "Dominic (nick) premium \u2728"
},
"country": "NL"
},
"counterparty_alias": {
"iban": null,
"is_light": null,
"display_name": "BoekenGigant",
"label_user": {
"uuid": null,
"display_name": "BoekenGigant",
"country": "NL",
"avatar": null,
"public_nick_name": "BoekenGigant"
},
"avatar": null,
"country": "NL"
},
"attachment": [],
"geolocation": {
"latitude": 52.387862883215,
"longitude": 4.8333778222355,
"altitude": 0,
"radius": 65
},
"batch_id": null,
"conversation": null,
"allow_chat": true,
"scheduled_id": null,
"address_billing": null,
"address_shipping": null
},
{
"id": 108864,
"created": "2017-11-08 11:20:03.950184",
"updated": "2017-11-08 11:20:03.950184",
"monetary_account_id": 213,
"amount": {
"currency": "EUR",
"value": "-24.95"
},
"description": "73d6df4a 680498 Your order #1234567",
"type": "IDEAL",
"merchant_reference": null,
"maturity_date": "2017-11-08",
"alias": {
"iban": "NL86BUNQ2025105541",
"is_light": false,
"display_name": "D. Howard",
"avatar": {
"uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec",
"image": [
{
"attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42",
"height": 1023,
"width": 1024,
"content_type": "image\/png"
}
],
"anchor_uuid": null
},
"label_user": {
"uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1",
"display_name": "D. Howard",
"country": "NL",
"avatar": {
"uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc",
"image": [
{
"attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980",
"height": 456,
"width": 456,
"content_type": "image\/jpeg"
}
],
"anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1"
},
"public_nick_name": "Dominic (nick) premium \u2728"
},
"country": "NL"
},
"counterparty_alias": {
"iban": null,
"is_light": null,
"display_name": "BoekenGigant",
"label_user": {
"uuid": null,
"display_name": "BoekenGigant",
"country": "NL",
"avatar": null,
"public_nick_name": "BoekenGigant"
},
"avatar": null,
"country": "NL"
},
"attachment": [],
"geolocation": {
"latitude": 52.387862883215,
"longitude": 4.8333778222355,
"altitude": 0,
"radius": 65
},
"batch_id": null,
"conversation": null,
"allow_chat": true,
"scheduled_id": null,
"address_billing": null,
"address_shipping": null
}
]
}
}
}
}
Loading

0 comments on commit d8037f5

Please sign in to comment.