Skip to content

Commit

Permalink
chore: fix CQ error
Browse files Browse the repository at this point in the history
  • Loading branch information
datamweb committed May 20, 2023
1 parent e9a4a8f commit 0b113d9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 41 deletions.
44 changes: 22 additions & 22 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
parameters:
tmpDir: build/phpstan
level: 5
paths:
- src/
- tests/
bootstrapFiles:
- vendor/codeigniter4/framework/system/Test/bootstrap.php
excludePaths:
- src/Config/Routes.php
- src/Views/*
ignoreErrors:
universalObjectCratesClasses:
- CodeIgniter\Entity
- CodeIgniter\Entity\Entity
- Faker\Generator
scanDirectories:
- vendor/codeigniter4/framework/system/Helpers
dynamicConstantNames:
- APP_NAMESPACE
- CI_DEBUG
- ENVIRONMENT
parameters:
tmpDir: build/phpstan
level: 5
paths:
- src/
- tests/
bootstrapFiles:
- vendor/codeigniter4/framework/system/Test/bootstrap.php
excludePaths:
- src/Config/Routes.php
- src/Views/*
ignoreErrors:
universalObjectCratesClasses:
- CodeIgniter\Entity
- CodeIgniter\Entity\Entity
- Faker\Generator
scanDirectories:
- vendor/codeigniter4/framework/system/Helpers
dynamicConstantNames:
- APP_NAMESPACE
- CI_DEBUG
- ENVIRONMENT
File renamed without changes.
25 changes: 6 additions & 19 deletions tests/Commands/SettingsPublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Tests\Commands;

use CodeIgniter\CodeIgniter;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\Filters\CITestStreamFilter;

Expand All @@ -13,35 +12,23 @@
*/
final class SettingsPublisherTest extends CIUnitTestCase
{
private $streamFilter;

protected function setUp(): void
{
parent::setUp();

if (version_compare(CodeIgniter::CI_VERSION, '4.3.0', '>=')) {
CITestStreamFilter::registration();
CITestStreamFilter::addOutputFilter();
CITestStreamFilter::addErrorFilter();
} else {
CITestStreamFilter::$buffer = '';

$this->streamFilter = stream_filter_append(STDOUT, 'CITestStreamFilter');
$this->streamFilter = stream_filter_append(STDERR, 'CITestStreamFilter');
}
CITestStreamFilter::registration();
CITestStreamFilter::addOutputFilter();
CITestStreamFilter::addErrorFilter();

}

protected function tearDown(): void
{
parent::tearDown();

if (version_compare(CodeIgniter::CI_VERSION, '4.3.0', '>=')) {
CITestStreamFilter::removeOutputFilter();
CITestStreamFilter::removeErrorFilter();
} else {
stream_filter_remove($this->streamFilter);
}
CITestStreamFilter::removeOutputFilter();
CITestStreamFilter::removeErrorFilter();

}

public function testPublishConfigFile(): void
Expand Down

0 comments on commit 0b113d9

Please sign in to comment.