Skip to content

Commit 04b6054

Browse files
Use RunsUpdateScripts trait in test (#500)
1 parent ae0baa1 commit 04b6054

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
},
3030
"require": {
31-
"statamic/cms": "^6.0",
31+
"statamic/cms": "^6.3",
3232
"pixelfear/composer-dist-plugin": "^0.1.6"
3333
},
3434
"require-dev": {
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<?php
22

3-
namespace Tests;
3+
namespace Tests\UpdateScripts;
44

55
use PHPUnit\Framework\Attributes\Test;
66
use Statamic\Facades\Addon;
77
use Statamic\SeoPro\UpdateScripts\MigrateToAddonSettings;
8+
use Statamic\Testing\Concerns\RunsUpdateScripts;
9+
use Tests\TestCase;
810

911
class MigrateToAddonSettingsTest extends TestCase
1012
{
13+
use RunsUpdateScripts;
14+
1115
#[Test]
1216
public function it_migrates_site_defaults_to_addon_settings()
1317
{
@@ -17,7 +21,7 @@ public function it_migrates_site_defaults_to_addon_settings()
1721
EOT
1822
);
1923

20-
$this->runUpdateScript();
24+
$this->runUpdateScript(MigrateToAddonSettings::class);
2125

2226
$settings = Addon::get('statamic/seo-pro')->settings();
2327

@@ -30,13 +34,4 @@ public function it_migrates_site_defaults_to_addon_settings()
3034

3135
$this->assertFileDoesNotExist(base_path('content/seo.yaml'));
3236
}
33-
34-
private function runUpdateScript()
35-
{
36-
$script = new MigrateToAddonSettings('statamic/seo-pro');
37-
38-
$script->update();
39-
40-
return $script;
41-
}
4237
}

0 commit comments

Comments
 (0)