Skip to content

Commit

Permalink
Merge pull request #377 from alies-dev/psalm-tests
Browse files Browse the repository at this point in the history
Setup .phpt tests (replace Codeception)
  • Loading branch information
alies-dev authored Mar 17, 2024
2 parents 2d5d698 + 29ceb32 commit 4320620
Show file tree
Hide file tree
Showing 79 changed files with 1,558 additions and 3,509 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.xml export-ignore
/codeception.yml export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
/UPGRADING.md export-ignore
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
exclude:
- php: 8.1
laravel: ^11.0
name: Acceptance P${{ matrix.php }} | L${{ matrix.laravel }} | ${{ matrix.dependencies == 'highest' && '↑' || '↓' }}
name: Type P${{ matrix.php }} | L${{ matrix.laravel }} | ${{ matrix.dependencies == 'highest' && '↑' || '↓' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -76,5 +76,5 @@ jobs:
composer require "illuminate/support:${{ matrix.laravel }}" --no-update
composer update --no-interaction --no-progress --prefer-dist --prefer-stable ${{ matrix.dependencies == 'lowest' && '--prefer-lowest' || '' }}
- name: Run Acceptance Tests
- name: Run Psalm/Type tests
run: composer test:type
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cache/*.stubphp
# PHPUnit
.phpunit.result.cache
.phpunit.cache/
phpunit.xml

# App tests
/tests-app/
14 changes: 0 additions & 14 deletions codeception.yml

This file was deleted.

13 changes: 3 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@
"vimeo/psalm": "^5.20"
},
"require-dev": {
"codeception/codeception": "^5.0",
"codeception/module-asserts": "^3.0",
"codeception/module-cli": "^2.0",
"codeception/module-filesystem": "^3.0",
"codeception/module-phpbrowser": "^3.0",
"laravel/framework": "^10.48 || ^11.0",
"phpunit/phpunit": "^10.5 || ^11.0",
"phpyh/psalm-tester": "^0.1.0",
"ramsey/collection": "^1.3",
"slevomat/coding-standard": "^8.8",
"squizlabs/php_codesniffer": "*",
Expand Down Expand Up @@ -76,10 +72,7 @@
"@test:unit",
"@test:type"
],
"test:type": [
"Composer\\Config::disableProcessTimeout",
"codecept run --skip-group skip"
],
"test:unit": "phpunit"
"test:type": "phpunit --testsuite=type",
"test:unit": "phpunit --testsuite=unit"
}
}
4 changes: 0 additions & 4 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<file>tests</file>
<exclude-pattern>cache/</exclude-pattern>
<exclude-pattern>tests/_run/</exclude-pattern>
<exclude-pattern>tests/Acceptance/_output</exclude-pattern>
<exclude-pattern>tests/Acceptance/_run</exclude-pattern>
<exclude-pattern>tests/Acceptance/_support</exclude-pattern>
<exclude-pattern>tests/Acceptance/Support/</exclude-pattern><!-- This code mostly copy-paste from https://github.com/psalm/codeception-psalm-module and thus may have different coding-style rules -->
<exclude-pattern>tests/Application/</exclude-pattern>
<exclude-pattern>tests/Unit/Handlers/Eloquent/Schema/migrations</exclude-pattern>
<exclude-pattern>tests-app/</exclude-pattern>
Expand Down
21 changes: 11 additions & 10 deletions phpunit.xml → phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true">
failOnWarning="true">
<testsuites>
<testsuite name="default">
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="type">
<directory>tests/Type</directory>
</testsuite>
</testsuites>
<coverage/>
<source>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory suffix=".php">src</directory>
<directory>src</directory>
</include>
</source>
</phpunit>
Loading

0 comments on commit 4320620

Please sign in to comment.