Skip to content

Commit 0d44dfa

Browse files
committed
Merge branch 'master' into statamic-6
2 parents 7e93375 + 01b9a44 commit 0d44dfa

21 files changed

+221
-201
lines changed

tests/ConfiguratorTest.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests;
44

5+
use PHPUnit\Framework\Attributes\Test;
56
use Statamic\Facades\Path;
67
use Statamic\Migrator\Configurator;
78

@@ -21,7 +22,7 @@ protected function path()
2122
return Path::tidy(config_path('statamic/configurator-test.php'));
2223
}
2324

24-
/** @test */
25+
#[Test]
2526
public function it_normalizes_mangled_indentation_and_ensures_trailing_commas()
2627
{
2728
$this->configurator->normalize();
@@ -41,7 +42,7 @@ public function it_normalizes_mangled_indentation_and_ensures_trailing_commas()
4142
);
4243
}
4344

44-
/** @test */
45+
#[Test]
4546
public function it_can_set_string_value_to_something_new()
4647
{
4748
$this->assertConfigFileContains(<<<'EOT'
@@ -70,7 +71,7 @@ public function it_can_set_string_value_to_something_new()
7071
);
7172
}
7273

73-
/** @test */
74+
#[Test]
7475
public function it_can_set_integer_value_to_something_new()
7576
{
7677
$this->assertConfigFileContains(<<<'EOT'
@@ -86,7 +87,7 @@ public function it_can_set_integer_value_to_something_new()
8687
);
8788
}
8889

89-
/** @test */
90+
#[Test]
9091
public function it_can_set_array_value_to_something_new()
9192
{
9293
$this->assertConfigFileContains(<<<'EOT'
@@ -123,7 +124,7 @@ public function it_can_set_array_value_to_something_new()
123124
);
124125
}
125126

126-
/** @test */
127+
#[Test]
127128
public function it_can_set_nested_array_value_to_something_new()
128129
{
129130
$this->assertConfigFileContains(<<<'EOT'
@@ -160,7 +161,7 @@ public function it_can_set_nested_array_value_to_something_new()
160161
);
161162
}
162163

163-
/** @test */
164+
#[Test]
164165
public function it_can_set_completely_new_values()
165166
{
166167
$this->configurator->set('lol', 'catz');
@@ -187,7 +188,7 @@ public function it_can_set_completely_new_values()
187188
);
188189
}
189190

190-
/** @test */
191+
#[Test]
191192
public function it_doesnt_set_if_falsey_value_is_passed()
192193
{
193194
$this->configurator->set('action', false);
@@ -200,7 +201,7 @@ public function it_doesnt_set_if_falsey_value_is_passed()
200201
);
201202
}
202203

203-
/** @test */
204+
#[Test]
204205
public function it_does_set_falsey_value_when_explicitly_allowed()
205206
{
206207
$this->configurator->set('action', false, true);
@@ -225,7 +226,7 @@ public function it_does_set_falsey_value_when_explicitly_allowed()
225226
);
226227
}
227228

228-
/** @test */
229+
#[Test]
229230
public function it_can_merge_into_array()
230231
{
231232
$this->assertConfigFileContains(<<<'EOT'
@@ -277,7 +278,7 @@ public function it_can_merge_into_array()
277278
);
278279
}
279280

280-
/** @test */
281+
#[Test]
281282
public function it_can_merge_into_nested_array()
282283
{
283284
$this->assertConfigFileContains(<<<'EOT'
@@ -303,7 +304,7 @@ public function it_can_merge_into_nested_array()
303304
);
304305
}
305306

306-
/** @test */
307+
#[Test]
307308
public function it_can_spaciously_merge_into_array()
308309
{
309310
$this->assertConfigFileContains(<<<'EOT'
@@ -350,7 +351,7 @@ public function it_can_spaciously_merge_into_array()
350351
);
351352
}
352353

353-
/** @test */
354+
#[Test]
354355
public function it_can_spaciously_merge_into_nested_array()
355356
{
356357
$this->assertConfigFileContains(<<<'EOT'
@@ -378,7 +379,7 @@ public function it_can_spaciously_merge_into_nested_array()
378379
);
379380
}
380381

381-
/** @test */
382+
#[Test]
382383
public function it_can_spaciously_merge_into_mangled_array()
383384
{
384385
$this->assertConfigFileContains(<<<'EOT'
@@ -422,7 +423,7 @@ public function it_can_spaciously_merge_into_mangled_array()
422423
);
423424
}
424425

425-
/** @test */
426+
#[Test]
426427
public function it_can_refresh_config()
427428
{
428429
$this->configurator->merge('disks_spacious.local', [
@@ -436,7 +437,7 @@ public function it_can_refresh_config()
436437
$this->assertEquals('beer', config('statamic.configurator-test.disks_spacious.local.root'));
437438
}
438439

439-
/** @test */
440+
#[Test]
440441
public function it_wont_merge_duplicate_values()
441442
{
442443
$this->assertConfigFileContains(<<<'EOT'
@@ -513,7 +514,7 @@ public function it_wont_merge_duplicate_values()
513514
);
514515
}
515516

516-
/** @test */
517+
#[Test]
517518
public function it_can_merge_multiple_array_items_with_children()
518519
{
519520
$this->configurator->merge('widgets', [

tests/ContentMigratorTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests;
44

5+
use PHPUnit\Framework\Attributes\Test;
56
use Statamic\Migrator\ContentMigrator;
67
use Statamic\Migrator\YAML;
78

@@ -48,7 +49,7 @@ private function migrateContent($content)
4849
return ContentMigrator::usingFieldset('speaker')->migrateContent($content);
4950
}
5051

51-
/** @test */
52+
#[Test]
5253
public function it_can_migrate_assets_fields()
5354
{
5455
$content = $this
@@ -83,7 +84,7 @@ public function it_can_migrate_assets_fields()
8384
$this->assertEquals($expected, $content);
8485
}
8586

86-
/** @test */
87+
#[Test]
8788
public function it_can_migrate_assets_fields_without_container_url()
8889
{
8990
$this->files->put($this->sitePath('content/assets/main.yaml'), 'title: Main');
@@ -120,7 +121,7 @@ public function it_can_migrate_assets_fields_without_container_url()
120121
$this->assertEquals($expected, $content);
121122
}
122123

123-
/** @test */
124+
#[Test]
124125
public function it_can_migrate_date_field()
125126
{
126127
$content = $this
@@ -162,7 +163,7 @@ public function it_can_migrate_date_field()
162163
$this->files->delete($this->sitePath('settings/system.yaml'));
163164
}
164165

165-
/** @test */
166+
#[Test]
166167
public function it_can_migrate_date_field_when_previous_timezone_was_not_utc()
167168
{
168169
// -5-hour offset
@@ -210,7 +211,7 @@ public function it_can_migrate_date_field_when_previous_timezone_was_not_utc()
210211
$this->files->delete($this->sitePath('settings/system.yaml'));
211212
}
212213

213-
/** @test */
214+
#[Test]
214215
public function it_can_migrate_term_fields()
215216
{
216217
$content = $this
@@ -244,10 +245,9 @@ public function it_can_migrate_term_fields()
244245
}
245246

246247
/**
247-
* @test
248-
*
249248
* @see https://github.com/statamic/cms/issues/3432
250-
**/
249+
*/
250+
#[Test]
251251
public function it_removes_empty_term_fields()
252252
{
253253
$this->withoutExceptionHandling();
@@ -323,7 +323,7 @@ private function termFields()
323323
];
324324
}
325325

326-
/** @test */
326+
#[Test]
327327
public function it_can_migrate_when_fieldset_has_fields_in_sections()
328328
{
329329
$content = $this
@@ -364,7 +364,7 @@ public function it_can_migrate_when_fieldset_has_fields_in_sections()
364364
$this->assertEquals($expected, $content);
365365
}
366366

367-
/** @test */
367+
#[Test]
368368
public function it_can_migrate_when_fieldset_has_fields_at_top_level()
369369
{
370370
$content = $this
@@ -389,7 +389,7 @@ public function it_can_migrate_when_fieldset_has_fields_at_top_level()
389389
$this->assertEquals($expected, $content);
390390
}
391391

392-
/** @test */
392+
#[Test]
393393
public function it_can_migrate_fields_within_replicators()
394394
{
395395
$content = $this
@@ -467,7 +467,7 @@ public function it_can_migrate_fields_within_replicators()
467467
$this->assertEquals($expected, $content);
468468
}
469469

470-
/** @test */
470+
#[Test]
471471
public function it_can_migrate_fields_within_bards()
472472
{
473473
$content = $this
@@ -552,7 +552,7 @@ public function it_can_migrate_fields_within_bards()
552552
$this->assertEquals($expected, $content);
553553
}
554554

555-
/** @test */
555+
#[Test]
556556
public function it_can_migrate_fields_within_grids()
557557
{
558558
$content = $this
@@ -612,7 +612,7 @@ public function it_can_migrate_fields_within_grids()
612612
$this->assertEquals($expected, $content);
613613
}
614614

615-
/** @test */
615+
#[Test]
616616
public function it_can_migrate_fields_within_partials()
617617
{
618618
$content = $this
@@ -692,7 +692,7 @@ public function it_can_migrate_fields_within_partials()
692692
$this->assertEquals($expected, $content);
693693
}
694694

695-
/** @test */
695+
#[Test]
696696
public function it_can_migrate_bards_with_no_sets()
697697
{
698698
$content = $this
@@ -719,7 +719,7 @@ public function it_can_migrate_bards_with_no_sets()
719719
$this->assertEquals($expected, $content);
720720
}
721721

722-
/** @test */
722+
#[Test]
723723
public function it_can_migrate_link_it_fields()
724724
{
725725
$content = $this
@@ -747,7 +747,7 @@ public function it_can_migrate_link_it_fields()
747747
$this->assertEquals($expected, $content);
748748
}
749749

750-
/** @test */
750+
#[Test]
751751
public function it_can_migrate_custom_layout()
752752
{
753753
$content = $this->migrateContent([
@@ -763,7 +763,7 @@ public function it_can_migrate_custom_layout()
763763
$this->assertEquals($expected, $content);
764764
}
765765

766-
/** @test */
766+
#[Test]
767767
public function it_removes_default_layout()
768768
{
769769
$content = $this->migrateContent([
@@ -778,7 +778,7 @@ public function it_removes_default_layout()
778778
$this->assertEquals($expected, $content);
779779
}
780780

781-
/** @test */
781+
#[Test]
782782
public function it_removes_custom_default_layout()
783783
{
784784
$this->files->put(base_path('site/settings/theming.yaml'), 'default_layout: custom_default');

0 commit comments

Comments
 (0)