From 1ee7a5a18b4ac3227ab831104c9efa499d5b4c44 Mon Sep 17 00:00:00 2001 From: Haley Pelletier Date: Fri, 27 Jun 2025 13:18:25 -0700 Subject: [PATCH 1/4] Remove faulty validation --- lib/Model/Letter.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/Model/Letter.php b/lib/Model/Letter.php index 450bfbb..fa2b027 100755 --- a/lib/Model/Letter.php +++ b/lib/Model/Letter.php @@ -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) { From 388b3025e782431487ac6fe3ba8600a4f8191dda Mon Sep 17 00:00:00 2001 From: Haley Pelletier Date: Fri, 27 Jun 2025 13:55:14 -0700 Subject: [PATCH 2/4] Unrelated fix for letters API --- lib/Api/LettersApi.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/Api/LettersApi.php b/lib/Api/LettersApi.php index b3dd3da..5aabe99 100755 --- a/lib/Api/LettersApi.php +++ b/lib/Api/LettersApi.php @@ -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(); From 0cebb17d0916000e19882b84e6746a2e75a6c154 Mon Sep 17 00:00:00 2001 From: Haley Pelletier Date: Fri, 27 Jun 2025 13:36:30 -0700 Subject: [PATCH 3/4] Get unit tests running in PRs --- .github/workflows/run_tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 6358886..fa976c6 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -17,13 +17,8 @@ jobs: - uses: php-actions/composer@v6 - name: Run Tests - uses: php-actions/phpunit@v3 + run: vendor/bin/phpunit --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 From f3da818a745bc14f8e7a545c0cdf64d9e032f418 Mon Sep 17 00:00:00 2001 From: Haley Pelletier Date: Fri, 27 Jun 2025 14:38:20 -0700 Subject: [PATCH 4/4] Only run unit tests --- .github/workflows/run_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index fa976c6..ab2a944 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -16,9 +16,11 @@ jobs: - uses: php-actions/composer@v6 - - name: Run Tests - run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage/coverage.xml --configuration=phpunit.xml.dist + - 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 + + # TODO: Run Integration Tests