Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dam-bal committed Dec 6, 2024
1 parent d93112a commit 07920be
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 20 deletions.
2 changes: 1 addition & 1 deletion checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo ""
echo "###################"
echo "# Static Analysis #"
echo "###################"
run_command "./vendor/bin/phpstan analyse src --level 9"
run_command "./vendor/bin/phpstan analyse src --level 8"

echo ""
echo "##################"
Expand Down
24 changes: 15 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="false"
failOnRisky="false"
failOnWarning="false">
shortenArraysForExportThreshold="10"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnPhpunitDeprecation="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnPhpunitDeprecations="true"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<coverage>
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory suffix=".php">src</directory>
<directory>src</directory>
</include>
</coverage>
</source>
</phpunit>
10 changes: 0 additions & 10 deletions src/Test.php

This file was deleted.

11 changes: 11 additions & 0 deletions src/TestClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace VendorOrProject;

final readonly class TestClass
{
public function sum(int $a, int $b): int
{
return $a + $b;
}
}
16 changes: 16 additions & 0 deletions tests/TestClassTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace VendorOrProject\Tests;

use PHPUnit\Framework\TestCase;
use VendorOrProject\TestClass;

final class TestClassTest extends TestCase
{
public function testSum(): void
{
$sut = new TestClass();

self::assertEquals(4, $sut->sum(2, 2));
}
}

0 comments on commit 07920be

Please sign in to comment.