To provide a place for unit tests, move approval tests and change config

This commit is contained in:
Sam Burns 2024-01-24 14:44:10 +00:00
parent bad5ca93fd
commit 46f45e2661
7 changed files with 27 additions and 5 deletions

View File

@ -21,12 +21,13 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Tests\\": "tests/approval/",
"PhpUnitTests\\": "tests/phpunit/",
"BehatTests\\": "tests/behat/contexts/"
}
},
"scripts": {
"tests": "./vendor/bin/phpunit; ./vendor/bin/behat;",
"tests": "./vendor/bin/phpunit --testsuite UnitTests; ./vendor/bin/phpunit --testsuite ApprovalTests; ./vendor/bin/behat;",
"test-coverage": "phpunit --coverage-html build/coverage",
"check-cs": "ecs check",
"fix-cs": "ecs check --fix",

View File

@ -6,8 +6,11 @@
</include>
</coverage>
<testsuites>
<testsuite name="AllTests">
<directory>./tests</directory>
<testsuite name="ApprovalTests">
<directory>./tests/approval</directory>
</testsuite>
<testsuite name="UnitTests">
<directory>./tests/phpunit</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@ -34,7 +34,7 @@ class ApprovalTest extends TestCase
ob_start();
$argv = ['', '30'];
include(__DIR__ . '/../fixtures/texttest_fixture.php');
include(__DIR__ . '/../../fixtures/texttest_fixture.php');
$output = ob_get_clean();

View File

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace PhpUnitTests;
use ApprovalTests\Approvals;
use GildedRose\GildedRose;
use GildedRose\Item;
use PHPUnit\Framework\TestCase;
class ExamplelTest extends TestCase
{
public function testFoo(): void
{
$this->assertTrue(true);
}
}