Skip to content

Commit

Permalink
Add mutation tests, raise phpstan 7. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored Nov 18, 2023
1 parent b226ef3 commit cebf778
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

name: mutation test

jobs:
mutation:
uses: php-forge/actions/.github/workflows/roave-infection.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
<a href="https://codecov.io/gh/yii2-extensions/asset-bootstrap5" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/asset-bootstrap5/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
</a>
<a href="https://dashboard.stryker-mutator.io/reports/github.com/yii2-extensions/asset-bootstrap5/main" target="_blank">
<img src="https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii2-extensions%2Fasset-bootstrap5%2Fmain" alt="Infection">
</a>
<a href="https://github.com/yii2-extensions/asset-bootstrap5/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg" alt="PHPStan">
</a>
<a href="https://github.com/yii2-extensions/asset-bootstrap5/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-5-blue" alt="PHPStan level">
<img src="https://img.shields.io/badge/PHPStan%20level-7-blue" alt="PHPStan level">
</a>
<a href="https://github.styleci.io/repos/719651888?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/719651888/shield?branch=main" alt="Code style">
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"maglnet/composer-require-checker": "^4.6",
"php-forge/support": "dev-main",
"phpunit/phpunit": "^10.2",
"roave/infection-static-analysis-plugin": "^1.32",
"yii2-extensions/phpstan": "dev-main"
},
"autoload": {
Expand Down Expand Up @@ -53,7 +54,8 @@
"allow-plugins": {
"yiisoft/yii2-composer": true,
"composer/installers": true,
"oomphinc/composer-installers-extender": true
"oomphinc/composer-installers-extender": true,
"infection/extension-installer": true
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
dynamicConstantNames:
- YII_ENV

level: 5
level: 7

paths:
- src
Expand Down
20 changes: 20 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MixedAssignment errorLevel="suppress" />
</issueHandlers>
</psalm>
4 changes: 4 additions & 0 deletions src/BootstrapCdnAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ final class BootstrapCdnAsset extends AssetBundle
{
/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $css = [
'https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css',
];

/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $cssOptions = [
'crossorigin' => 'anonymous',
Expand Down
2 changes: 2 additions & 0 deletions src/BootstrapPluginAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ final class BootstrapPluginAsset extends AssetBundle

/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $depends = [
BootstrapAsset::class,
Expand Down
6 changes: 6 additions & 0 deletions src/BootstrapPluginCdnAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ final class BootstrapPluginCdnAsset extends AssetBundle
{
/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $js = [
'https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js',
];

/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $jsOptions = [
'crossorigin' => 'anonymous',
Expand All @@ -28,6 +32,8 @@ final class BootstrapPluginCdnAsset extends AssetBundle

/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $depends = [
BootstrapCdnAsset::class,
Expand Down
4 changes: 4 additions & 0 deletions src/PopperCdnAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ final class PopperCdnAsset extends AssetBundle
{
/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $js = [
'https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js',
];

/**
* @inheritDoc
*
* @phpstan-var array<array-key, mixed>
*/
public $jsOptions = [
'crossorigin' => 'anonymous',
Expand Down

0 comments on commit cebf778

Please sign in to comment.