AspireCloud/tests/Feature/API/WpOrg/PassThroughControllerTest.php
Chuck Adams c7bc95191a
Improve test coverage (#217)
* fix(test): use pg_trgm if not exists

* test: add test for /core/importers

* test: add test for gp-icon and theme screenshot download

* test: inline most test assertion functions into assertExactJson

* test: add hot tags tests

* test: add plugin updates tests

* test: 100% coverage of download routes

* test: 100% coverage of plugin update controller

* test: 100% coverage of all api controllers

* fix: make PassThroughController drop unexpected requests

* refactor: rm special case for / in PassThroughController

* test: auto-fake facades

* test: test PassThroughController for 100% coverage on Controllers

* test: drop auto-fakes because facades are made of hate

* zap: rm unused build-container-images action

* test: add test for AssetCacheHit event

* deps: composer upgrade and bump
2025-03-31 12:53:25 -06:00

15 lines
516 B
PHP

<?php
use App\Http\Controllers\PassThroughController;
it('should throw an exception for unexpected pass-through requests', function () {
$this->get('/events/1.0')->assertServerError();
});
it('should pass through when expecting to be hit', function () {
Http::fake(); // should already be, but make sure
PassThroughController::$expectsHit = true;
$this->get('/events/1.0')->assertOk(); // response is still mocked, so it won't tell us anything more
});
// TODO: write test for real auth token