|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project are documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [2.0.0] |
| 9 | + |
| 10 | +A full modernization of the client. The 1.x flat method surface is preserved |
| 11 | +(see *Backward compatibility* below), but the internals, error handling and |
| 12 | +minimum PHP version have changed. |
| 13 | + |
| 14 | +### Added |
| 15 | +- New resource-oriented entry point `TestingBot\Client` with grouped accessors: |
| 16 | + `tests()`, `builds()`, `storage()`, `tunnels()`, `user()`, `teamManagement()`, |
| 17 | + `lab()`, `labSuites()`, `screenshots()`, `devices()`, `browsers()`, |
| 18 | + `configuration()`, `jobs()`. |
| 19 | +- Full API coverage: full test CRUD, user info/keys/update, team management |
| 20 | + (sub-accounts), codeless tests **and** suites, screenshots, tunnel |
| 21 | + create/get/list, devices, browsers, configuration IP ranges, and a job poller |
| 22 | + (`jobs()->waitForCompletion()`). |
| 23 | +- Typed exception hierarchy: `AuthenticationException` (401/403), |
| 24 | + `NotFoundException` (404), `RateLimitException` (429, with `getRetryAfter()`), |
| 25 | + `ApiException` (other non-2xx, with `getStatusCode()`/`getResponseBody()`), |
| 26 | + and `NetworkException` (transport failures). All implement |
| 27 | + `TestingBot\Exception\TestingBotExceptionInterface`. |
| 28 | +- A mockable transport seam (`TestingBot\Http\HttpClientInterface`) so the |
| 29 | + client can be unit-tested without hitting the live API. |
| 30 | +- HTTP timeouts, explicit TLS verification, a versioned User-Agent, and |
| 31 | + transport-level error detection. |
| 32 | +- `Client::request()` low-level escape hatch for endpoints not yet wrapped. |
| 33 | +- `phpstan` (level 8), `php-cs-fixer` (PSR-12), `.editorconfig`, and a GitHub |
| 34 | + Actions matrix across PHP 8.1–8.4. |
| 35 | + |
| 36 | +### Changed |
| 37 | +- **Errors now throw exceptions** instead of returning an array containing an |
| 38 | + `error` key. Wrap calls in `try/catch` (see README "Migrating from 1.x"). |
| 39 | +- Minimum PHP version is now **8.1**. |
| 40 | +- Autoloading moved from PSR-0 to **PSR-4** (the `TestingBot\TestingBotAPI` |
| 41 | + class name is unchanged). |
| 42 | +- `composer.json` `type` corrected to `library`. |
| 43 | +- `TestingBotAPI::createLabTest()` now wraps `$extras` keys as plain field |
| 44 | + names automatically (no need to pre-wrap them as `test[...]`). |
| 45 | +- `TestingBotAPI::modifyLabTestSteps()` keeps sending the exact legacy body for |
| 46 | + compatibility; prefer `client()->lab()->setSteps()`, which URL-encodes values. |
| 47 | + |
| 48 | +### Fixed |
| 49 | +- File uploads no longer fatal on PHP 8: `mime_content_type()` replaced with the |
| 50 | + `fileinfo` extension. |
| 51 | +- Network failures (DNS, timeout, TLS) are surfaced as `NetworkException` |
| 52 | + instead of being silently swallowed as `null`. |
| 53 | + |
| 54 | +### Removed |
| 55 | +- The bogus runtime dependencies `phpunit/phpunit-selenium`, |
| 56 | + `brianium/paratest` and `appium/php-client` (they were never used by the |
| 57 | + client and forced unnecessary installs). |
| 58 | +- The obsolete `.travis.yml` (CI runs on GitHub Actions). |
| 59 | + |
| 60 | +### Backward compatibility |
| 61 | +All 1.x `TestingBotAPI` methods keep their names and signatures and continue to |
| 62 | +work. The behavioural change to be aware of is that failures now throw instead |
| 63 | +of returning `['error' => ...]`. Argument-validation now throws |
| 64 | +`TestingBot\Exception\InvalidArgumentException`, a subclass of the SPL |
| 65 | +`\InvalidArgumentException`, so existing `catch (\Exception $e)` blocks still |
| 66 | +catch it. |
| 67 | + |
| 68 | +## [1.0.3] and earlier |
| 69 | + |
| 70 | +See the git history for changes prior to the 2.0 rewrite. |
0 commit comments