Skip to content

Commit 4c90ddb

Browse files
committed
Merge branch '4.x' into laravel-13
2 parents 5e58303 + 5d5930a commit 4c90ddb

6 files changed

Lines changed: 34 additions & 28 deletions

File tree

tests/ConcurrentTasksTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
namespace Tests;
44

5+
use PHPUnit\Framework\Attributes\Test;
56
use Spatie\Fork\Fork;
67
use Statamic\StaticSite\ConcurrentTasks;
78

89
class ConcurrentTasksTest extends TestCase
910
{
10-
/** @test */
11+
#[Test]
1112
public function it_runs_callbacks()
1213
{
1314
$one = function () {

tests/ConsecutiveTasksTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
namespace Tests;
44

5+
use PHPUnit\Framework\Attributes\Test;
56
use Statamic\StaticSite\ConsecutiveTasks;
67

78
class ConsecutiveTasksTest extends TestCase
89
{
9-
/** @test */
10+
#[Test]
1011
public function it_runs_callbacks()
1112
{
1213
$callbacksRan = 0;

tests/GenerateTest.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests;
44

55
use Illuminate\Filesystem\Filesystem;
6+
use PHPUnit\Framework\Attributes\Test;
67
use Statamic\Facades\Config;
78
use Statamic\Facades\URL;
89
use Tests\Concerns\RunsGeneratorCommand;
@@ -19,7 +20,7 @@ protected function tearDown(): void
1920
parent::tearDown();
2021
}
2122

22-
/** @test */
23+
#[Test]
2324
public function it_generates_pages_for_site_fixture()
2425
{
2526
$files = $this->generate();
@@ -68,7 +69,7 @@ public function it_generates_pages_for_site_fixture()
6869
$this->assertStringContainsString('<h1>Article Title: Eight</h1>', $files['articles/eight/index.html']);
6970
}
7071

71-
/** @test */
72+
#[Test]
7273
public function it_generates_specific_pages_when_passing_urls_as_args()
7374
{
7475
$this
@@ -92,7 +93,7 @@ public function it_generates_specific_pages_when_passing_urls_as_args()
9293
$this->assertStringContainsString('<h1>Articles Index Page Title</h1>', $files['articles/index.html']);
9394
}
9495

95-
/** @test */
96+
#[Test]
9697
public function it_generates_pages_to_custom_destination()
9798
{
9899
Config::set('statamic.ssg.destination', $this->destination = base_path('custom_export'));
@@ -105,7 +106,7 @@ public function it_generates_pages_to_custom_destination()
105106
$this->cleanUpDestination();
106107
}
107108

108-
/** @test */
109+
#[Test]
109110
public function it_clears_destination_directory_when_generating_site()
110111
{
111112
$this
@@ -117,7 +118,7 @@ public function it_clears_destination_directory_when_generating_site()
117118
$this->generate();
118119
}
119120

120-
/** @test */
121+
#[Test]
121122
public function it_can_generate_site_without_clearing_destination_directory()
122123
{
123124
$this
@@ -129,7 +130,7 @@ public function it_can_generate_site_without_clearing_destination_directory()
129130
$this->generate(['--disable-clear' => true]);
130131
}
131132

132-
/** @test */
133+
#[Test]
133134
public function it_generates_paginated_pages()
134135
{
135136
$this->files->put(resource_path('views/articles/index.antlers.html'), <<<'EOT'
@@ -207,7 +208,7 @@ public function it_generates_paginated_pages()
207208
$this->assertStringContainsString('Prev Link: /articles/page/2', $index);
208209
}
209210

210-
/** @test */
211+
#[Test]
211212
public function it_generates_pagination_with_custom_page_name_and_route()
212213
{
213214
// Here we'll override the `pagination_route`.
@@ -290,7 +291,7 @@ public function it_generates_pagination_with_custom_page_name_and_route()
290291
$this->assertStringContainsString('Prev Link: /articles/p-2', $index);
291292
}
292293

293-
/** @test */
294+
#[Test]
294295
public function it_generates_associated_paginated_pages_when_generating_only_urls_with_pagination()
295296
{
296297
$this->files->put(resource_path('views/articles/index.antlers.html'), <<<'EOT'
@@ -364,7 +365,7 @@ public function it_generates_associated_paginated_pages_when_generating_only_url
364365
$this->assertStringContainsString('Prev Link: /articles/page/2', $index);
365366
}
366367

367-
/** @test */
368+
#[Test]
368369
public function it_enforces_trailing_slashes_when_config_enabled()
369370
{
370371
Config::set('statamic.ssg.enforce_trailing_slashes', true);
@@ -377,7 +378,7 @@ public function it_enforces_trailing_slashes_when_config_enabled()
377378
$this->assertStringContainsString('<a href="http://cool-runnings.com/articles/three/">Three</a>', $index);
378379
}
379380

380-
/** @test */
381+
#[Test]
381382
public function it_enforces_trailing_slashes_on_paginated_urls_when_config_enabled()
382383
{
383384
Config::set('statamic.ssg.enforce_trailing_slashes', true);
@@ -411,7 +412,7 @@ public function it_enforces_trailing_slashes_on_paginated_urls_when_config_enabl
411412
$this->assertStringContainsString('Prev Link: /articles/page/2/', $page3);
412413
}
413414

414-
/** @test */
415+
#[Test]
415416
public function it_still_generates_404_when_trailing_slashes_config_is_enabled()
416417
{
417418
Config::set('statamic.ssg.enforce_trailing_slashes', true);

tests/Localized/GenerateTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests\Localized;
44

55
use Illuminate\Filesystem\Filesystem;
6+
use PHPUnit\Framework\Attributes\Test;
67
use Statamic\Facades\Config;
78
use Statamic\Facades\Site;
89
use Statamic\Facades\URL;
@@ -49,7 +50,7 @@ protected function tearDown(): void
4950
parent::tearDown();
5051
}
5152

52-
/** @test */
53+
#[Test]
5354
public function it_generates_pages_for_localized_site_fixture()
5455
{
5556
$files = $this->generate();
@@ -124,7 +125,7 @@ public function it_generates_pages_for_localized_site_fixture()
124125
$this->assertStringContainsString('<h1>Article Title: Le Five</h1>', $files['fr/le-articles/le-five/index.html']);
125126
}
126127

127-
/** @test */
128+
#[Test]
128129
public function it_generates_localized_paginated_pages()
129130
{
130131
$this->files->put(resource_path('views/articles/index.antlers.html'), <<<'EOT'
@@ -185,7 +186,7 @@ public function it_generates_localized_paginated_pages()
185186
$this->assertStringContainsString('Prev Link: /fr/le-articles/page/1', $index);
186187
}
187188

188-
/** @test */
189+
#[Test]
189190
public function it_generates_localized_pagination_with_custom_page_name_and_route()
190191
{
191192
// Here we'll override the `pagination_route`.
@@ -251,7 +252,7 @@ public function it_generates_localized_pagination_with_custom_page_name_and_rout
251252
$this->assertStringContainsString('Prev Link: /fr/le-articles/p-1', $index);
252253
}
253254

254-
/** @test */
255+
#[Test]
255256
public function it_generates_associated_paginated_pages_when_generating_only_localized_urls_with_pagination()
256257
{
257258
$this->files->put(resource_path('views/articles/index.antlers.html'), <<<'EOT'
@@ -311,7 +312,7 @@ public function it_generates_associated_paginated_pages_when_generating_only_loc
311312
$this->assertStringContainsString('Prev Link: /fr/le-articles/page/1', $index);
312313
}
313314

314-
/** @test */
315+
#[Test]
315316
public function it_enforces_trailing_slashes_when_config_enabled()
316317
{
317318
Config::set('statamic.ssg.enforce_trailing_slashes', true);
@@ -329,7 +330,7 @@ public function it_enforces_trailing_slashes_when_config_enabled()
329330
$this->assertStringContainsString('<a href="http://cool-runnings.com/fr/le-articles/le-three/">Le Three</a>', $frIndex);
330331
}
331332

332-
/** @test */
333+
#[Test]
333334
public function it_enforces_trailing_slashes_on_localized_paginated_urls_when_config_enabled()
334335
{
335336
Config::set('statamic.ssg.enforce_trailing_slashes', true);
@@ -362,7 +363,7 @@ public function it_enforces_trailing_slashes_on_localized_paginated_urls_when_co
362363
$this->assertStringContainsString('Prev Link: /fr/le-articles/page/1/', $frPage2);
363364
}
364365

365-
/** @test */
366+
#[Test]
366367
public function it_still_generates_404_when_trailing_slashes_config_is_enabled()
367368
{
368369
Config::set('statamic.ssg.enforce_trailing_slashes', true);

tests/PageTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
namespace Tests;
44

55
use Illuminate\Filesystem\Filesystem;
6+
use PHPUnit\Framework\Attributes\Test;
67
use Statamic\Contracts\Entries\Entry;
78
use Statamic\StaticSite\Page;
89

910
class PageTest extends TestCase
1011
{
11-
/** @test */
12+
#[Test]
1213
public function it_gets_the_path()
1314
{
1415
$entry = $this->mock(Entry::class);
@@ -20,7 +21,7 @@ public function it_gets_the_path()
2021
$this->assertEquals('/path/to/static/foo/bar', $page->directory());
2122
}
2223

23-
/** @test */
24+
#[Test]
2425
public function it_gets_the_path_of_a_url_with_a_file_extension()
2526
{
2627
$entry = $this->mock(Entry::class);
@@ -32,7 +33,7 @@ public function it_gets_the_path_of_a_url_with_a_file_extension()
3233
$this->assertEquals('/path/to/static/foo/bar', $page->directory());
3334
}
3435

35-
/** @test */
36+
#[Test]
3637
public function it_gets_the_path_of_the_404_url()
3738
{
3839
$entry = $this->mock(Entry::class);

tests/RequestTest.php

Lines changed: 6 additions & 5 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\Entries\Collection;
67
use Statamic\Entries\Entry;
78
use Statamic\Facades\Site;
@@ -10,14 +11,14 @@
1011

1112
class RequestTest extends TestCase
1213
{
13-
/** @test */
14+
#[Test]
1415
public function gets_scheme()
1516
{
1617
$this->assertEquals('http', (new Request)->setConfig(['base_url' => 'http://test.com'])->getScheme());
1718
$this->assertEquals('https', (new Request)->setConfig(['base_url' => 'https://test.com'])->getScheme());
1819
}
1920

20-
/** @test */
21+
#[Test]
2122
public function gets_http_host()
2223
{
2324
$this->assertEquals('test.com', (new Request)->setConfig(['base_url' => 'http://test.com'])->getHttpHost());
@@ -26,7 +27,7 @@ public function gets_http_host()
2627
$this->assertEquals('test.com', (new Request)->setConfig(['base_url' => 'https://test.com/subdirectory/'])->getHttpHost());
2728
}
2829

29-
/** @test */
30+
#[Test]
3031
public function gets_base_url()
3132
{
3233
$this->assertEquals('', (new Request)->setConfig(['base_url' => 'http://test.com'])->getBaseUrl());
@@ -35,7 +36,7 @@ public function gets_base_url()
3536
$this->assertEquals('/subdirectory', (new Request)->setConfig(['base_url' => 'http://test.com/subdirectory/'])->getBaseUrl());
3637
}
3738

38-
/** @test */
39+
#[Test]
3940
public function gets_path()
4041
{
4142
// The current site needs to be explicitly set, otherwise it will try to
@@ -55,7 +56,7 @@ public function gets_path()
5556
$this->assertEquals('foo', $request->path());
5657
}
5758

58-
/** @test */
59+
#[Test]
5960
public function it_can_forget_query_param()
6061
{
6162
$request = new Request;

0 commit comments

Comments
 (0)