Skip to content

Commit

Permalink
Address test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
victorsfleite committed Jun 20, 2024
1 parent b9a79ef commit e2b2f05
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testThrowsErrorIfNoConfig":1},"times":{"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ConfigurationTest::testPassesWhenConfigIsSet":0.035,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ConfigurationTest::testPassesWhenConfigIsBooleanAndSetToFalse":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ConfigurationTest::testFailsWhenConfigIsNotSet":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ConfigurationTest::testLoadsConfigHints":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksDatabaseAccessible#No options checks default":0.017,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksDatabaseAccessible#Empty options checks default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksDatabaseAccessible#Default checks default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksDatabaseAccessible#Connection checks connection":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksDatabaseInaccessible":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksConfigValues#No options checks default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksConfigValues#Empty options checks default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksConfigValues#Default checks default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\DatabaseTest::testChecksConfigValues#Connection checks connection":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testHandlesNormalCheck":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testHandlesSkippedPassCheck":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testHandlesSkippedFailCheck":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testHandlesOptionalFail":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testChecksRequiredConfig":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testFailsOnMissingConfig":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\PreflightCheckTest::testLoadsConfigHintsFromOptions":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksRedisIsAccessible#No options is default":0.008,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksRedisIsAccessible#Default is default":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksRedisIsAccessible#Banana is banana":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksRedisIsDown":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksRedisIsNotConnected":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testChecksConfigValues":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\RedisTest::testDoesNotCheckPasswordForNoAuthConfig":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testGetsRawData":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testGetsDisplayData":0.001,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testSetsAndGetsName":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testGuessesName":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testPassesOrFails":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testSetsMessage":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testSkipsStep":0,"Kirschbaum\\PreflightChecks\\Tests\\Checks\\ResultTest::testRequiredStep":0,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Passes with no checks":0.073,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Passes with passing check":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Fails with failed check":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Passes with skipped check":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Passes with failed skipped check":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Fails with mix":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Passes with mix of failed skipped":0.003,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Provides options and passes":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Provides options and fails":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Can pass full config without options":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Can fail full config with options":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testPerformsPreflightChecks#Full config allows duplicates":0.002,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testThrowsErrorIfNoConfig":0.003,"Kirschbaum\\PreflightChecks\\Tests\\Commands\\PreflightCheckCommandTest::testEnvironmentIsCaseInsensitive":0.002}}
39 changes: 14 additions & 25 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml" />
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Kirschbaum\PreflightChecks\Tests\Checks;

use Kirschbaum\PreflightChecks\Checks\PreflightCheck;
use Orchestra\Testbench\TestCase;
use Kirschbaum\PreflightChecks\Checks\Result;
use Kirschbaum\PreflightChecks\Checks\PreflightCheck;
use Kirschbaum\PreflightChecks\PreflightChecksServiceProvider;
use Kirschbaum\PreflightChecks\Tests\Helpers\CanAccessProtected;
use Orchestra\Testbench\TestCase;

abstract class BasePreflightCheckTest extends TestCase
abstract class BasePreflightCheck extends TestCase
{
use CanAccessProtected;

Expand All @@ -17,11 +17,6 @@ abstract class BasePreflightCheckTest extends TestCase
*/
protected $preflightCheckClass;

protected function getPackageProviders($app)
{
return [PreflightChecksServiceProvider::class];
}

public function checkConfigValues(PreflightCheck $preflightCheck)
{
$config = $this->getProtectedProperty($preflightCheck, 'requiredConfig');
Expand All @@ -36,6 +31,11 @@ public function checkConfigValues(PreflightCheck $preflightCheck)
}
}

protected function getPackageProviders($app)
{
return [PreflightChecksServiceProvider::class];
}

protected function assertPassed(Result $result): void
{
$this->assertTrue($result->passed());
Expand Down
4 changes: 2 additions & 2 deletions tests/Checks/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Kirschbaum\PreflightChecks\Tests\Checks;

use Kirschbaum\PreflightChecks\Checks\Configuration;
use Kirschbaum\PreflightChecks\Checks\Result;
use Kirschbaum\PreflightChecks\Checks\Configuration;

class ConfigurationTest extends BasePreflightCheckTest
class ConfigurationTest extends BasePreflightCheck
{
protected $preflightCheckClass = Configuration::class;

Expand Down
2 changes: 1 addition & 1 deletion tests/Checks/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Kirschbaum\PreflightChecks\Checks\Result;
use Kirschbaum\PreflightChecks\Checks\Database;

class DatabaseTest extends BasePreflightCheckTest
class DatabaseTest extends BasePreflightCheck
{
private const TEST_DEFAULT_DB_CONNECTION = 'test_default';

Expand Down
2 changes: 1 addition & 1 deletion tests/Checks/RedisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Kirschbaum\PreflightChecks\Checks\Result;
use Illuminate\Support\Facades\Redis as RedisFacade;

class RedisTest extends BasePreflightCheckTest
class RedisTest extends BasePreflightCheck
{
protected $preflightCheckClass = Redis::class;

Expand Down

0 comments on commit e2b2f05

Please sign in to comment.