Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ jobs:

- name: Test coverage
run: composer tests-coverage

- name: Test coverage
run: composer tests-mutation
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"scripts": {
"tests": "pest --stop-on-failure --colors",
"tests-coverage": "pest --coverage --min=90",
"tests-mutation": "pest --mutate",
"lint": [
"@phpstan",
"@cs",
Expand All @@ -41,7 +42,8 @@
"phpstan/phpstan": "^2.1",
"rector/rector": "*",
"squizlabs/php_codesniffer": "^3.13",
"slevomat/coding-standard": "^8.20"
"slevomat/coding-standard": "^8.20",
"orchestra/testbench": "^10.4"
},
"config": {
"allow-plugins": {
Expand Down
7 changes: 6 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ test:

# command for run tests coverage
test-coverage:
docker exec -i scribe-plugin composer tests
docker exec -i scribe-plugin composer tests-coverage

# command for run tests mutation
test-mutation:
docker exec -i scribe-plugin composer tests-mutation

4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
colors="true"
>
<testsuites>
<testsuite name="Unit tests">
<directory>tests/Unit</directory>
<testsuite name="All tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
Expand Down
19 changes: 19 additions & 0 deletions tests/ArchlTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

test('Not use debugging functions')
->expect(['dd', 'dump', 'die'])
->not->toBeUsed();

test('Php code should follow basic standards')
->preset()
->php();

test('Code should pass basic security checks')
->preset()
->security();

test('Core architecture rules with exceptions')
->preset()
->strict();
7 changes: 7 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

declare(strict_types=1);

use Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests;

use PHPUnit\Framework\TestCase as BaseTestCase;
use Orchestra\Testbench\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
namespace Tests\Unit;

use DenisKorbakov\SkeletonPhpDocker\Example;
use Tests\TestCase;

uses(TestCase::class);
mutates(Example::class);

test('foo', function (): void {
$example = new Example();
Expand Down