Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: make dataprovider static & some #17

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autoformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
coverage: none
extensions: mbstring
php-version: 8.1
php-version: 8.3

- run: composer install --no-interaction --no-progress --no-suggest

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
coverage: pcov
php-version: 8.1
php-version: 8.3

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress
Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ parameters:
- message: "#Method .* throws checked exception .* but it's missing from the PHPDoc @throws tag.#"
paths:
- tests/*
- message: "#@dataProvider .* related method must be static in PHPUnit 10 and newer.#"
paths:
- tests/*
# Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable
editorUrl: '%%relFile%%:%%line%%'
editorUrlTitle: '%%relFile%%:%%line%%'
19 changes: 9 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.result.cache"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>

<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
spawnia marked this conversation as resolved.
Show resolved Hide resolved
</phpunit>
10 changes: 5 additions & 5 deletions tests/Unit/RequestParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testPostWithJsonLike(string $contentType): void
/**
* @return iterable<array{string}>
*/
public function jsonLikeContentTypes(): iterable
public static function jsonLikeContentTypes(): iterable
{
yield ['application/json'];
yield ['application/graphql+json'];
Expand Down Expand Up @@ -75,7 +75,7 @@ public function testPostWithQueryApplicationGraphQL(string $contentType): void
/**
* @return iterable<array{string}>
*/
public function graphQLContentTypes(): iterable
public static function graphQLContentTypes(): iterable
{
yield ['application/graphql'];
yield ['application/graphql;charset=UTF-8'];
Expand Down Expand Up @@ -103,7 +103,7 @@ public function testPostWithRegularForm(string $contentType): void
/**
* @return iterable<array{string}>
*/
public function formContentTypes(): iterable
public static function formContentTypes(): iterable
{
yield ['application/x-www-form-urlencoded'];
yield ['application/x-www-form-urlencoded;bla;blub'];
Expand Down Expand Up @@ -166,7 +166,7 @@ public function testNonsensicalContentTypes(string $contentType): void
/**
* @return iterable<array{string}>
*/
public function nonsensicalContentTypes(): iterable
public static function nonsensicalContentTypes(): iterable
{
yield ['foobar'];
yield ['application/foobar'];
Expand Down Expand Up @@ -263,7 +263,7 @@ public function testMultipartFormRequest(string $contentType): void
/**
* @return iterable<array{string}>
*/
public function multipartFormContentTypes(): iterable
public static function multipartFormContentTypes(): iterable
{
yield ['multipart/form-data'];
yield ['multipart/form-data; boundary=----WebkitFormBoundaryasodfh98ho1hfdsdfadfNX'];
Expand Down
Loading