Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 support fix phpunit deprecations #2586

Closed
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
99 changes: 54 additions & 45 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false"
bootstrap="tests/bootstrap.php" colors="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false"
stopOnError="false" stopOnFailure="false" verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory suffix=".blade.php">./tests</directory>
</exclude>
<report>
<clover outputFile="./.github/clover.xml"/>
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
</report>
</coverage>
<testsuites>
<testsuite name="Browser">
<directory>tests/Browser</directory>
</testsuite>
<testsuite name="Unit">
<directory>tests/unit</directory>
<directory>tests/integration</directory>
</testsuite>
</testsuites>
<logging/>
<php>
<env name="APP_KEY" value="base64:DV8kQN5a+4MwAIQ5uk1WNafxO+/Efab0K20uVMDJ2UE="/>
<env name="APP_ENV" value="testing"/>
<env name="APP_URL" value="127.0.0.1:8001"/>
<env name="APP_DEBUG" value="true"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="CACHE_STORE" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="mysql"/>
<env name="DB_DATABASE" value="twill_testing_3x"/>
<env name="LOG_CHANNEL" value="single"/>
<env name="DB_USERNAME" value="root"/>
<env name="DB_PASSWORD" value="root"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="tests/bootstrap.php"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage>
<report>
<clover outputFile="./.github/clover.xml"/>
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
</report>
</coverage>
<testsuites>
<testsuite name="Browser">
<directory>tests/Browser</directory>
</testsuite>
<testsuite name="Unit">
<directory>tests/unit</directory>
<directory>tests/integration</directory>
</testsuite>
</testsuites>
<logging/>
<php>
<env name="APP_KEY" value="base64:DV8kQN5a+4MwAIQ5uk1WNafxO+/Efab0K20uVMDJ2UE="/>
<env name="APP_ENV" value="testing"/>
<env name="APP_URL" value="127.0.0.1:8001"/>
<env name="APP_DEBUG" value="true"/>
<env name="ADMIN_APP_PATH" value="/twill"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="CACHE_STORE" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="mysql"/>
<env name="DB_DATABASE" value="twill_testing_3x"/>
<env name="LOG_CHANNEL" value="single"/>
<env name="DB_USERNAME" value="root"/>
<env name="DB_PASSWORD" value="root"/>
<env name="XDEBUG_MODE" value="coverage"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory suffix=".blade.php">./tests</directory>
</exclude>
</source>
</phpunit>
7 changes: 5 additions & 2 deletions tests/Browser/BrowserTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function configTwill($app): void
$app['config']->set('twill.auth_login_redirect_path', '/twill');
$app['config']->set('twill.enabled.users-2fa', true);
$app['config']->set('twill.enabled.users-image', true);
$app['config']->set('twill.auth_login_redirect_path', '/twill');
$app['config']->set('twill.models.user', User::class);
$app['config']->set('translatable.locales', ['en', 'fr', 'pt-BR']);
}
Expand Down Expand Up @@ -133,8 +132,12 @@ public function backupDistFolder(): void
{
$this->restoreAndCleanupDistBackup();

if (!file_exists($dirToCopy = __DIR__ . '/../../dist')) {
return;
}

// Make a backup of the dist folder.
$dirToCopy = __DIR__ . '/../../dist';

$dirToCopyBackup = __DIR__ . '/../../dist-backup';

shell_exec("cp -r $dirToCopy $dirToCopyBackup");
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/FrontendDateConversionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testWithDateTime(Carbon $targetDate, array $expectedTime, bool $
);
}

public function timesDataProvider(): array
public static function timesDataProvider(): array
{
return [
'winterAMPM' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/ScheduleDatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function testWithDateTime(Carbon $from, Carbon $to, array $expectedTime,
);
}

public function timesDataProvider(): array
public static function timesDataProvider(): array
{
return [
'winterAMPM' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testIndexDataProperties(
$this->assertEquals(!$default, $controller->getIndexOptionTest($indexOption));
}

public function simplePropertyOptions(): array
public static function simplePropertyOptions(): array
{
return [
'create' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Repositories/TagsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testTagSlugsCharacters(string $string, string $slug): void
$this->assertEquals($slug, $author->tags()->get()[0]->slug);
}

public function slugExamples(): array
public static function slugExamples(): array
{
return [
'default' => [
Expand Down
Loading