Jonas Renggli 6344bfa779
[php-flight] fix: use static PHPUnit assertions (#21253)
Static analysis tools such as PHPStan report errors when dynamic calls are used
for static methods.

```
ERROR Dynamic call to static method PHPUnit\Framework\Assert::assertEquals().
```

According to the source code of PHPUnit
(https://github.com/sebastianbergmann/phpunit/blob/9.5.0/src/Framework/Assert.php)
the function is indeed static.

```php
public static function assertTrue($condition, string $message = ''): void
```

This change updates to PHP Flight test template `register_routes_test.mustache`
to use static calls for PHPUnit assertions.
2025-05-11 22:22:34 +08:00
..

Requirements

PHP 8.1 and later

Installation & Usage

  1. Set up flight as usual - see Flight documentation
  2. Generate using the OpenAPI generator
  3. Subclass some/all generated Abstract*Api and overwrite the methods you'd like handled. When implementing the *Stream methods, make sure to stream the response and not implement the non-stream method.
  4. Register routes for your subclassed apis: RegisterRoutes::registerRoutes(new MyApiHandler());