Skip to content

Commit 1e81b5a

Browse files
committed
Failing tests for v0.1 features
1 parent d654a8d commit 1e81b5a

File tree

9 files changed

+31
-0
lines changed

9 files changed

+31
-0
lines changed

tests/Feature/Console/Commands/CurlCommandTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public function curlCommandFixtures()
2929
'POST request with JSON data' => ['post-json'],
3030
'POST request with multipart/form-data' => ['post-with-form-data'],
3131
'GET request with headers' => ['with-headers'],
32+
'JSON request with content type' => ['json-with-content-type'],
33+
'Mailgun example request' => ['mailgun-example'],
34+
'Digital Ocean example request' => ['digital-ocean-example'],
35+
'Stripe example request' => ['stripe-example'],
3236
];
3337
}
3438
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -H 'Accept: application/json' -d 'format=json' https://example.com
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Http::acceptJson()
2+
->get('https://example.com' [
3+
'format' => 'json',
4+
]);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -H "Authorization: Bearer abcdef0123456789" -H "Content-Type: application/json" -d '{"name": "example.com", "ip_address": "127.0.0.1"}' -X POST "https://api.digitalocean.com/v2/domains"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Http::withBody('{"name": "example.com", "ip_address": "127.0.0.1"}')
2+
->withToken('abcdef0123456789')
3+
->post('https://api.digitalocean.com/v2/domains')

tests/fixtures/mailgun-example.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -s -X POST --user 'api:0987654321' https://api.mailgun.net/v3/example.com/messages -F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' -F to=YOU@YOUR_DOMAIN_NAME -F [email protected] -F subject='Hello' -F text='Testing some Mailgun awesomeness!'

tests/fixtures/mailgun-example.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Http::asMultipart()
2+
->withBasicAuth('api', '0987654321')
3+
->post('https://api.mailgun.net/v3/example.com/messages', [
4+
'from' => 'Excited User <mailgun@YOUR_DOMAIN_NAME>',
5+
'to' => ['YOU@YOUR_DOMAIN_NAME', '[email protected]'],
6+
'subject' => 'Hello',
7+
'text' => 'Testing some Mailgun awesomeness!',
8+
]);

tests/fixtures/stripe-example.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -X POST https://api.stripe.com/v1/charges -u sk_test_sjp0J5IpIZ4o7L0OtmCW3s7p: -d amount=2000 -d currency=usd -d source=tok_visa -d "metadata[order_id]"=6735

tests/fixtures/stripe-example.out

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Http::asForm()
2+
->withBasicAuth('sk_test_sjp0J5IpIZ4o7L0OtmCW3s7p')
3+
->post('https://api.stripe.com/v1/charges', [
4+
'amount' => 2000,
5+
'currency' => 'usd',
6+
'source' => 'tok_visa',
7+
'metadata[order_id]' => 6735,
8+
]);

0 commit comments

Comments
 (0)