Skip to content
Merged
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
11 changes: 4 additions & 7 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ jobs:

- uses: php-actions/composer@v6

- name: Run Tests
uses: php-actions/phpunit@v3
- name: Run Unit Tests
run: vendor/bin/phpunit --group unit--coverage-text --coverage-clover=coverage/coverage.xml --configuration=phpunit.xml.dist
env:
LOB_API_TEST_KEY: ${{ secrets.LOB_API_TEST_KEY }}
LOB_API_LIVE_KEY: ${{ secrets.LOB_API_LIVE_KEY }}
XDEBUG_MODE: coverage
with:
bootstrap: vendor/autoload.php
configuration: phpunit.xml.dist
php_extensions: xdebug
args: --coverage-text --coverage-clover=coverage/coverage.xml

# TODO: Run Integration Tests
26 changes: 15 additions & 11 deletions lib/Api/LettersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,21 @@ public function createWithHttpInfo($letter_editable, $idempotency_key = null, $f
$options = $this->createHttpClientOption();
$requestError = null;
try {
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
if ($file !== null) {
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
} else {
$response = $this->client->send($request, $options);
}
} catch (RequestException $e) {
$errorBody = json_decode($e->getResponse()->getBody()->getContents())->error;
$requestError = new LobError();
Expand Down
6 changes: 0 additions & 6 deletions lib/Model/Letter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,12 +1108,6 @@ public function getTrackingEvents()
*/
public function setTrackingEvents($tracking_events)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {

if (!is_null($tracking_events) && (count($tracking_events) > 0)) {
throw new \InvalidArgumentException('invalid value for $tracking_events when calling Letter., number of items must be less than or equal to 0.');
}
}
$this->container['tracking_events'] = [];
if ($tracking_events) {
foreach ($tracking_events as $point) {
Expand Down