Skip to content

Feature/saloon v3#46

Merged
WalrusSoup merged 11 commits into
mainfrom
feature/saloon-v3
Mar 26, 2026
Merged

Feature/saloon v3#46
WalrusSoup merged 11 commits into
mainfrom
feature/saloon-v3

Conversation

@WalrusSoup
Copy link
Copy Markdown
Contributor

@WalrusSoup WalrusSoup commented Mar 26, 2026

Summary

Upgrades the library from Saloon v3 to Saloon v4, with all tests passing on a clean scratch org.

What changed

  • Upgrade to saloonphp/saloon v4
  • Upgrade to pestphp/pest ^4.0 and phpstan/phpstan ^2.0
  • Bump PHP requirement to >=8.4
  • Replace removed AccessTokenAuthenticator::serialize()/unserialize() with custom JSON serialization
  • Replace removed Saloon\Contracts\Response with Saloon\Http\Response
  • Remove stale @phpstan-ignore-line comments
  • Migrate phpunit.xml to PHPUnit 12 schema
  • Replace deprecated League\Csv methods (createFromString, createFromStream, createFromPath) with current API (fromString, from)
  • Fix deprecated fakerphp/faker property access (use method calls)
  • Set phpstan phpVersion to 80400 in phpstan.neon.dist
  • Rewrite all integration tests to use standard Salesforce objects (Account) instead of custom fixtures (Virtual_Youtuber__c, Totoro, etc.)
  • Update README with scratch org and sandbox testing setup instructions using modern sf CLI
  • Lock composer.lock to PHP 8.4 platform to prevent Symfony version mismatches in CI

Why

  • Tests previously depended on custom objects and Apex classes that had to be manually deployed to a scratch org. Now tests run against any scratch org out of the box.
  • PHPStan passes clean at level 5 with 0 errors.
  • All 88 tests pass with 0 failures and 0 deprecation warnings.

Test plan

  • All 88 tests pass locally against a scratch org
  • PHPStan level 5 passes with 0 errors
  • Verify CI passes on GitHub

WalrusSoup and others added 11 commits October 5, 2023 10:06
[ci skip] [skip ci]
Apply fixes from StyleCI

[ci skip] [skip ci]
* adds serializeAuthenticator and unserializeAuthenticator for v4 support

addresses security release of v4 to address CVE-2026-3394,
CVE-2026-33182, and CVE-2026-33183

* fix: replace non-existent HasBody trait with HasStringBody in UploadJobData

Saloon v4 only ships HasBody as an interface (Contracts\Body\HasBody),
not as a trait. HasStringBody is the correct trait for CSV text payloads.

* fix: add missing implements HasBody to UpdateRecords

Saloon v4 body traits assert that the request implements HasBody at
boot time and throw BodyException if it does not. UpdateRecords used
HasJsonBody but omitted the interface, making every PATCH request fail.

* fix: update WithSalesforceAuthHeader plugin for Saloon v4

mergeHeaders() was removed in v4; replace with headers()->merge().
SalesforceApi::token() did not exist; add a static $accessToken property
populated across all four auth paths (login, restoreAccessToken,
completeOAuthLogin, restoreExistingOAuthConnection) and expose it via
a public static token() accessor.
…om fixtures

Replace all references to Virtual_Youtuber__c, Totoro, TotoroPage, and
other custom org fixtures with standard objects (Account) so tests run
against any scratch org without pre-seeded metadata.
createFromString -> fromString, createFromStream -> from,
createFromPath -> from, per league/csv 9.27.0 deprecations.
Replace deprecated <coverage> element with <source> and remove
non-existent ./app directory.
Replace outdated sfdx commands and custom metadata instructions with
modern sf CLI steps. Add sandbox setup section. No custom objects or
seed scripts needed — tests use standard objects.
- Bump PHP requirement to >=8.4
- Replace removed Saloon\Contracts\Response with Saloon\Http\Response
- Replace AccessTokenAuthenticator::unserialize() with custom unserializeAuthenticator()
- Remove stale @phpstan-ignore-line comments
- Set phpstan phpVersion to 80400
- Update composer.lock for PHP 8.4 platform
- Update actions/checkout to v4
- Replace ramsey/composer-install with direct composer install
- Remove stale feature/saloon-v2 branch trigger
@tance77
Copy link
Copy Markdown
Member

tance77 commented Mar 26, 2026

Should be good now all tests passing on scratch org. Subbed out your Anime Themed tests for actual standard objects and updated the gh env to be 8.4 @WalrusSoup

@WalrusSoup WalrusSoup merged commit c618489 into main Mar 26, 2026
1 check passed
@WalrusSoup WalrusSoup deleted the feature/saloon-v3 branch March 26, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants