Skip to content

Commit bb0360e

Browse files
committed
Revert "Restore assertions for unit tests"
This reverts commit 4323967.
1 parent 4323967 commit bb0360e

File tree

9 files changed

+0
-37
lines changed

9 files changed

+0
-37
lines changed

tests/Api/CallbackTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ public function test_can_handle_callback(): void
162162
{
163163
$call = new Callback($this->data);
164164
$response = $call->call();
165-
$this->assertInstanceOf(CallbackResponse::class, $response);
166165
$this->assertSame('d28df6b4-122d-49e2-add0-19c8271260b0', $response->paymentId);
167166
$this->assertSame('000000022', $response->shopOrderId);
168167
$this->assertSame('incomplete', $response->status);

tests/Api/CaptureReservationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function test_capture_reservation_transactions_data(): void
5454
$response = $api->call();
5555
$this->assertInstanceOf(CaptureReservationResponse::class, $response);
5656
$transaction = $response->Transactions[0];
57-
$this->assertInstanceOf(Transaction::class, $transaction);
5857
$this->assertSame('1', $transaction->TransactionId);
5958
$this->assertSame('978', $transaction->MerchantCurrency);
6059
$this->assertSame(13.37, $transaction->FraudRiskScore);

tests/Api/FundingListTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,13 @@ public function test_funding_object(): void
7777
$response = $api->call();
7878
$this->assertInstanceOf(FundingsResponse::class, $response);
7979
$funding = $response->Fundings[0];
80-
$this->assertInstanceOf(Funding::class, $funding);
8180

8281
$this->assertSame('CreatedByTest', $funding->Filename);
8382
$this->assertSame('1234567890123456', $funding->ContractIdentifier);
8483
$this->assertCount(2, $funding->Shops);
8584
$this->assertSame('TestAcquirer', $funding->Acquirer);
86-
$this->assertInstanceOf(\DateTime::class, $funding->FundingDate);
8785
$this->assertSame('26-09-2010', $funding->FundingDate->format('d-m-Y'));
8886
$this->assertSame('50.00 EUR', $funding->Amount);
89-
$this->assertInstanceOf(\DateTime::class, $funding->CreatedDate);
9087
$this->assertSame('27-09-2010', $funding->CreatedDate->format('d-m-Y'));
9188
$this->assertSame('http://localhost/merchant.php/API/fundingDownload?id=1', $funding->DownloadLink);
9289
}

tests/Api/HeaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function test_get_header_error_data(): void
3434
$api = $this->getapi();
3535
$api->call();
3636
} catch (ResponseHeaderException $e) {
37-
$this->assertInstanceOf(Header::class, $e->getHeader());
3837
$this->assertSame('200', $e->getHeader()->ErrorCode);
3938
$this->assertSame('This request has error', $e->getHeader()->ErrorMessage);
4039
}

tests/Api/InvoiceTextTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,11 @@ public function test_object(): void
5858
$this->assertStringStartsWith('Fordringen er overdraget', $response->MandatoryInvoiceText);
5959
$this->assertSame('7373', $response->InvoiceNumber);
6060
$this->assertSame('832', $response->CustomerNumber);
61-
$this->assertInstanceOf(\DateTime::class, $response->InvoiceDate);
6261
$this->assertSame('10-03-2011', $response->InvoiceDate->format('d-m-Y'));
63-
$this->assertInstanceOf(\DateTime::class, $response->DueDate);
6462
$this->assertSame('24-03-2011', $response->DueDate->format('d-m-Y'));
6563
$this->assertCount(1, $response->TextInfos);
6664
$this->assertSame('Password', $response->TextInfos[0]->Name);
6765
$this->assertSame('xxxxxx', $response->TextInfos[0]->Value);
68-
$this->assertInstanceOf(Address::class, $response->Address);
6966
$this->assertSame('John', $response->Address->Firstname);
7067
$this->assertSame('John', $response->Address->Lastname);
7168
$this->assertSame('Anywhere Street 12', $response->Address->Address);

tests/Api/PaymentRequestTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public function test_options_url(): void
117117
$this->assertSame('kg', $line['unitCode']);
118118

119119
// Config
120-
$this->assertIsArray($parts['config']);
121120
/** @var array<string> $config */
122121
$config = $parts['config'];
123122
$this->assertSame(sprintf('%s/%s', self::CONFIG_URL, 'form'), $config['callback_form']);

tests/Api/PaymentsTest.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public function test_payments_routing(): void
7373
->setPaymentId('mypaymentid');
7474
$api->call();
7575

76-
$this->assertInstanceOf(Request::class, $api->getRawRequest());
7776
$this->assertInstanceOf(Response::class, $api->getRawResponse());
7877

7978
$this->assertSame($this->getExceptedUri('payments/'), $api->getRawRequest()->getUri()->getPath());
@@ -120,7 +119,6 @@ public function test_multiple_payment_transaction_count(): void
120119
public function test_multiple_payment_transaction_data(): void
121120
{
122121
$data = $this->getMultiplePaymentTransaction()[0];
123-
$this->assertInstanceOf(Transaction::class, $data);
124122

125123
$this->assertSame('1', $data->TransactionId);
126124
$this->assertSame('ccc1479c-37f9-4962-8d2c-662d75117e9d', $data->PaymentId);
@@ -144,24 +142,16 @@ public function test_multiple_payment_transaction_data(): void
144142
$this->assertSame(1.00, $data->CapturedAmount);
145143
$this->assertSame(0.0, $data->RefundedAmount);
146144
$this->assertSame(0.0, $data->RecurringDefaultAmount);
147-
$this->assertInstanceOf(\DateTime::class, $data->CreatedDate);
148-
$this->assertInstanceOf(\DateTime::class, $data->UpdatedDate);
149145
$this->assertSame('28-09-2010', $data->CreatedDate->format('d-m-Y'));
150146
$this->assertSame('28-09-2010', $data->UpdatedDate->format('d-m-Y'));
151147
$this->assertSame('CreditCard', $data->PaymentNature);
152148
$this->assertSame('eCommerce', $data->PaymentSource);
153149
$this->assertSame(13.37, $data->FraudRiskScore);
154150
$this->assertSame('Fraud detection explanation', $data->FraudExplanation);
155151

156-
// Payment nature service
157-
$this->assertInstanceOf(PaymentNatureService::class, $data->PaymentNatureService);
158-
159152
// Payment Infos
160153
$this->assertCount(3, $data->PaymentInfos);
161154

162-
// Customer info
163-
$this->assertInstanceOf(CustomerInfo::class, $data->CustomerInfo);
164-
165155
// ReconciliationIdentifiers
166156
$this->assertCount(1, $data->ReconciliationIdentifiers);
167157
}
@@ -172,7 +162,6 @@ public function test_multiple_payment_transaction_data(): void
172162
public function test_multiple_payment_paymentnatureservice_data(): void
173163
{
174164
$data = $this->getMultiplePaymentTransaction()[0]->PaymentNatureService;
175-
$this->assertInstanceOf(PaymentNatureService::class, $data);
176165

177166
$this->assertSame('TestAcquirer', $data->name);
178167
$this->assertTrue($data->SupportsRefunds);
@@ -234,36 +223,26 @@ public function test_multiple_payment_customerinfo_data(): void
234223
$this->assertSame('support', $data->Username);
235224
$this->assertSame('+45 7020 0056', $data->CustomerPhone);
236225
$this->assertSame('12345678', $data->OrganisationNumber);
237-
$this->assertInstanceOf(Country::class, $data->CountryOfOrigin);
238226

239227
$country = $data->CountryOfOrigin;
240-
$this->assertInstanceOf(Country::class, $country);
241228
$this->assertSame('DK', $country->Country);
242229
$this->assertSame('BillingAddress', $country->Source);
243230

244-
$this->assertInstanceOf(Address::class, $data->BillingAddress);
245-
246231
$address = $data->BillingAddress;
247-
$this->assertInstanceOf(Address::class, $address);
248232
$this->assertSame('Palle', $address->Firstname);
249233
$this->assertSame('Simonsen', $address->Lastname);
250234
$this->assertSame('Rosenkæret 13', $address->Address);
251235
$this->assertSame('Søborg', $address->City);
252236
$this->assertSame('2860', $address->PostalCode);
253237
$this->assertSame('DK', $address->Country);
254238

255-
$this->assertInstanceOf(Address::class, $data->ShippingAddress);
256-
257239
$address = $data->ShippingAddress;
258-
$this->assertInstanceOf(Address::class, $address);
259240
$this->assertNull($address->Firstname);
260241
$this->assertNull($address->Lastname);
261242
$this->assertNull($address->Address);
262243
$this->assertNull($address->City);
263244
$this->assertNull($address->PostalCode);
264245
$this->assertNull($address->Country);
265-
266-
$this->assertInstanceOf(Address::class, $data->RegisteredAddress);
267246
}
268247

269248
/**
@@ -272,12 +251,10 @@ public function test_multiple_payment_customerinfo_data(): void
272251
public function test_multiple_payment_reconciliationidentifiers_data(): void
273252
{
274253
$data = $this->getMultiplePaymentTransaction()[0]->ReconciliationIdentifiers[0];
275-
$this->assertInstanceOf(ReconciliationIdentifier::class, $data);
276254

277255
$this->assertSame('f4e2533e-c578-4383-b075-bc8a6866784a', $data->Id);
278256
$this->assertSame(1.00, $data->Amount);
279257
$this->assertSame('captured', $data->Type);
280-
$this->assertInstanceOf(\DateTime::class, $data->Date);
281258
$this->assertSame('28-09-2010', $data->Date->format('d-m-Y'));
282259
$this->assertSame('978', $data->currency);
283260
}

tests/Api/RefundCapturedReservationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function test_capture_refund_transactions_data(): void
5757
$response = $api->call();
5858
$this->assertInstanceOf(RefundResponse::class, $response);
5959
$transaction = $response->Transactions[0];
60-
$this->assertInstanceOf(Transaction::class, $transaction);
6160
$this->assertSame('1', $transaction->TransactionId);
6261
$this->assertSame('978', $transaction->MerchantCurrency);
6362
$this->assertSame(13.37, $transaction->FraudRiskScore);

tests/Api/TerminalsTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function test_header(): void
3333
$api = $this->getTerminals();
3434
$response = $api->call();
3535
$this->assertInstanceOf(TerminalsResponse::class, $response);
36-
$this->assertInstanceOf(\DateTime::class, $response->Header->Date);
3736
$this->assertSame('07-01-2016', $response->Header->Date->format('d-m-Y'));
3837
$this->assertSame('API/getTerminals', $response->Header->Path);
3938
$this->assertSame('0', $response->Header->ErrorCode);
@@ -61,8 +60,6 @@ public function test_response_terminal(): void
6160
$this->assertCount(2, $response->Terminals);
6261

6362
$terminal = $response->Terminals[0];
64-
$this->assertInstanceOf(Terminal::class, $terminal);
65-
$this->assertSame('AltaPay Multi-Nature Terminal', $terminal->Title);
6663
$this->assertSame('DK', $terminal->Country);
6764
$this->assertCount(4, $terminal->Natures);
6865
$this->assertCount(4, $terminal->Methods);

0 commit comments

Comments
 (0)