Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP - update and publish SDK #8

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/workflows/sdk_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ jobs:
concurrency:
group: php-sdk-check
steps:
- name: Authenticate with AWS
uses: goshippo/shippo-action-workflows/.github/actions/[email protected]
with:
environment: dev-main
oidc-name: shippo-php-sdk-pipeline
login-to-ecr: false

- name: Get Speakeasy Secrets Manager
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
dev-main-speakeasy-api-key
name-transformation: uppercase
parse-json-secrets: true

- name: Check out repository
uses: actions/checkout@v4

Expand All @@ -56,4 +41,4 @@ jobs:
- name: Check
run: make check
env:
SHIPPO_TOKEN: ${{ env.DEV_MAIN_SPEAKEASY_API_KEY_SHIPPO_TOKEN }}
SHIPPO_TOKEN: ${{ secrets.SHIPPO_TOKEN }}
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ LOCAL_SPEC_FILE=${BUILD_DIR}public-api.yaml

check: test

clean:
php composer.phar clear-cache
rm -rf vendor/
rm -f composer.lock

install:
php composer.phar install

Expand Down
27 changes: 27 additions & 0 deletions tests/Shippo/API/AddressTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Shippo\API;
require 'vendor/autoload.php';

use Shippo\API;
use Shippo\API\Models\Components\Address;
use Shippo\API\Models\Components\AddressPaginatedList;

final class AddressTest extends IntegrationTestCase
{


public function testListAllAddresses()
{
$response = $this->getSdk()->addresses->list(
page: 1,
results: 10,
shippoApiVersion: '2018-02-08'

);

$this->assertEquals(200, $response->statusCode);
$this->assertNotNull($response->addressPaginatedList);
$this->assertInstanceOf(AddressPaginatedList::class, $response->addressPaginatedList);
}
}
1 change: 1 addition & 0 deletions tests/Shippo/API/PurchaseLabelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public function testPurchaseLabelUsingReferenceIds()
];
$transactionCreateResponse = $this->getSdk()->transactions->create($transactionCreateRequest);
$this->assertNotNull($transactionCreateResponse->transaction);
$this->assertEquals(201, $transactionCreateResponse->statusCode);
$transaction = $transactionCreateResponse->transaction;
$this->assertInstanceOf(Transaction::class, $transaction);
$this->assertIsString($transaction->rate);
Expand Down