Skip to content

Commit 25ed271

Browse files
Adding Laravel 11 support
1 parent 78ec868 commit 25ed271

19 files changed

+174
-156
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [8.1, 8.2, 8.3]
12+
php: [8.2, 8.3]
1313
dependency-version: [prefer-lowest, prefer-stable]
1414

1515
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"type": "library",
1818
"license": "MIT",
1919
"require": {
20-
"php": "^8.1",
21-
"arcanedev/php-html": "^7.0",
22-
"arcanedev/support": "^10.0"
20+
"php": "^8.2",
21+
"arcanedev/php-html": "^8.0",
22+
"arcanedev/support": "^11.0"
2323
},
2424
"require-dev": {
2525
"ext-dom": "*",
26-
"laravel/framework": "^10.0",
26+
"laravel/framework": "^11.0",
2727
"laravel/pint": "^1.14",
28-
"orchestra/testbench-core": "^8.23.4",
29-
"phpunit/phpunit": "^10.0.7"
28+
"orchestra/testbench-core": "^9.0",
29+
"phpunit/phpunit": "^10.5|^11.0"
3030
},
3131
"autoload": {
3232
"psr-4": {
@@ -48,7 +48,7 @@
4848
},
4949
"extra": {
5050
"branch-alias": {
51-
"dev-develop": "6.x-dev"
51+
"dev-develop": "7.x-dev"
5252
},
5353
"laravel": {
5454
"providers": [

phpunit.xml.dist

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
bootstrap="vendor/autoload.php"
55
colors="true"
66
>
7+
<source>
8+
<include>
9+
<directory>./src</directory>
10+
</include>
11+
</source>
712
<testsuites>
813
<testsuite name="Package Test Suite">
9-
<directory>./tests/</directory>
14+
<directory>./tests</directory>
1015
</testsuite>
1116
</testsuites>
1217
<coverage>
13-
<include>
14-
<directory>./src</directory>
15-
</include>
1618
<report>
1719
<clover outputFile="build/coverage/clover.xml"/>
1820
<html outputDirectory="build/coverage/html"/>

tests/Entities/AnalyticsTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Arcanedev\SeoHelper\Entities\Analytics;
1010
use Arcanedev\SeoHelper\Tests\TestCase;
1111
use Arcanedev\SeoHelper\Tests\Traits\CanAssertsGoogleAnalytics;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
/**
1415
* Class AnalyticsTest
@@ -57,7 +58,7 @@ public function tearDown(): void
5758
| -----------------------------------------------------------------
5859
*/
5960

60-
/** @test */
61+
#[Test]
6162
public function it_can_be_instantiated(): void
6263
{
6364
$expectations = [
@@ -71,15 +72,15 @@ public function it_can_be_instantiated(): void
7172
}
7273
}
7374

74-
/** @test */
75+
#[Test]
7576
public function it_must_render_empty_on_init(): void
7677
{
7778
$this->analytics = new Analytics();
7879

7980
static::assertEmpty($this->analytics->render());
8081
}
8182

82-
/** @test */
83+
#[Test]
8384
public function it_can_render(): void
8485
{
8586
static::assertGoogleAnalytics('UA-12345678-9', $this->analytics->render());

tests/Entities/DescriptionTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Arcanedev\SeoHelper\Exceptions\InvalidArgumentException;
1111
use Arcanedev\SeoHelper\Tests\TestCase;
1212
use Illuminate\Support\Str;
13+
use PHPUnit\Framework\Attributes\Test;
1314

1415
/**
1516
* Class DescriptionTest
@@ -51,7 +52,7 @@ public function tearDown(): void
5152
| -----------------------------------------------------------------
5253
*/
5354

54-
/** @test */
55+
#[Test]
5556
public function it_can_be_instantiated(): void
5657
{
5758
$expectations = [
@@ -65,7 +66,7 @@ public function it_can_be_instantiated(): void
6566
}
6667
}
6768

68-
/** @test */
69+
#[Test]
6970
public function it_can_make(): void
7071
{
7172
$this->description = Description::make('Cool description about this package');
@@ -81,15 +82,15 @@ public function it_can_make(): void
8182
}
8283
}
8384

84-
/** @test */
85+
#[Test]
8586
public function it_can_get_default_description(): void
8687
{
8788
$content = $this->getDefaultContent();
8889

8990
static::assertSame($content, $this->description->getContent());
9091
}
9192

92-
/** @test */
93+
#[Test]
9394
public function it_can_set_and_get_content(): void
9495
{
9596
$content = 'Cool description about this package';
@@ -99,7 +100,7 @@ public function it_can_set_and_get_content(): void
99100
static::assertSame($content, $this->description->getContent());
100101
}
101102

102-
/** @test */
103+
#[Test]
103104
public function it_can_set_and_get_max_length(): void
104105
{
105106
$max = 150;
@@ -109,7 +110,7 @@ public function it_can_set_and_get_max_length(): void
109110
static::assertSame($max, $this->description->getMax());
110111
}
111112

112-
/** @test */
113+
#[Test]
113114
public function it_must_throw_invalid_max_length_value(): void
114115
{
115116
$this->expectException(InvalidArgumentException::class);
@@ -118,7 +119,7 @@ public function it_must_throw_invalid_max_length_value(): void
118119
$this->description->setMax(0);
119120
}
120121

121-
/** @test */
122+
#[Test]
122123
public function it_can_render(): void
123124
{
124125
$this->description->set(
@@ -131,7 +132,7 @@ public function it_can_render(): void
131132
static::assertHtmlStringEqualsHtmlString($expected, $this->description->render());
132133
}
133134

134-
/** @test */
135+
#[Test]
135136
public function it_can_render_empty_description(): void
136137
{
137138
$this->description->set('');
@@ -140,7 +141,7 @@ public function it_can_render_empty_description(): void
140141
static::assertEmpty((string) $this->description);
141142
}
142143

143-
/** @test */
144+
#[Test]
144145
public function it_can_render_long_title(): void
145146
{
146147
$content = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ullamco laboris aliquip commodo.';

tests/Entities/KeywordsTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Arcanedev\SeoHelper\Contracts\Renderable;
99
use Arcanedev\SeoHelper\Entities\Keywords;
1010
use Arcanedev\SeoHelper\Tests\TestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
/**
1314
* Class KeywordsTest
@@ -49,7 +50,7 @@ public function tearDown(): void
4950
| -----------------------------------------------------------------
5051
*/
5152

52-
/** @test */
53+
#[Test]
5354
public function it_can_be_instantiated(): void
5455
{
5556
$expectations = [
@@ -63,7 +64,7 @@ public function it_can_be_instantiated(): void
6364
}
6465
}
6566

66-
/** @test */
67+
#[Test]
6768
public function it_can_get_default_content(): void
6869
{
6970
$content = $this->getDefaultContent();
@@ -72,7 +73,7 @@ public function it_can_get_default_content(): void
7273
static::assertSame($content, $this->keywords->getContent());
7374
}
7475

75-
/** @test */
76+
#[Test]
7677
public function it_can_set_and_get_content(): void
7778
{
7879
$content = $this->getDefaultContent();
@@ -94,7 +95,7 @@ public function it_can_set_and_get_content(): void
9495
static::assertSame([$keyword], $this->keywords->getContent());
9596
}
9697

97-
/** @test */
98+
#[Test]
9899
public function it_can_add_a_keyword(): void
99100
{
100101
$content = $this->getDefaultContent();
@@ -111,7 +112,7 @@ public function it_can_add_a_keyword(): void
111112
static::assertSame($content, $this->keywords->getContent());
112113
}
113114

114-
/** @test */
115+
#[Test]
115116
public function it_can_add_many_keywords(): void
116117
{
117118
$content = $this->getDefaultContent();
@@ -130,7 +131,7 @@ public function it_can_add_many_keywords(): void
130131
static::assertSame($content, $this->keywords->getContent());
131132
}
132133

133-
/** @test */
134+
#[Test]
134135
public function it_can_render(): void
135136
{
136137
$content = $this->getDefaultContent();
@@ -160,7 +161,7 @@ public function it_can_render(): void
160161
static::assertHtmlStringEqualsHtmlString($expected, $this->keywords->render());
161162
}
162163

163-
/** @test */
164+
#[Test]
164165
public function it_can_make(): void
165166
{
166167
$keywords = $this->getDefaultContent();

tests/Entities/MetaCollectionTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Arcanedev\SeoHelper\Entities\MetaCollection;
99
use Arcanedev\SeoHelper\Tests\TestCase;
1010
use Illuminate\Support\Collection;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
/**
1314
* Class MetaCollectionTest
@@ -47,7 +48,7 @@ public function tearDown(): void
4748
| -----------------------------------------------------------------
4849
*/
4950

50-
/** @test */
51+
#[Test]
5152
public function it_can_be_instantiated(): void
5253
{
5354
$expectations = [
@@ -63,7 +64,7 @@ public function it_can_be_instantiated(): void
6364
static::assertCount(0, $this->metas);
6465
}
6566

66-
/** @test */
67+
#[Test]
6768
public function it_can_add_meta(): void
6869
{
6970
$this->metas->addOne('robots', 'noindex, nofollow');
@@ -75,7 +76,7 @@ public function it_can_add_meta(): void
7576
static::assertCount(2, $this->metas);
7677
}
7778

78-
/** @test */
79+
#[Test]
7980
public function it_can_render_meta_tags(): void
8081
{
8182
$this->metas->addOne('robots', 'noindex, nofollow');
@@ -86,7 +87,7 @@ public function it_can_render_meta_tags(): void
8687
static::assertSame($expected, (string) $this->metas);
8788
}
8889

89-
/** @test */
90+
#[Test]
9091
public function it_can_render_link_tags(): void
9192
{
9293
$this->metas->addOne('canonical', $this->baseUrl);

tests/Entities/MiscTagsTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Arcanedev\SeoHelper\Contracts\Renderable;
99
use Arcanedev\SeoHelper\Entities\MiscTags;
1010
use Arcanedev\SeoHelper\Tests\TestCase;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
/**
1314
* Class MiscTagsTest
@@ -51,7 +52,7 @@ public function tearDown(): void
5152
| -----------------------------------------------------------------
5253
*/
5354

54-
/** @test */
55+
#[Test]
5556
public function it_can_be_instantiated(): void
5657
{
5758
$expectations = [
@@ -65,7 +66,7 @@ public function it_can_be_instantiated(): void
6566
}
6667
}
6768

68-
/** @test */
69+
#[Test]
6970
public function it_can_render_canonical(): void
7071
{
7172
$this->misc->setUrl($url = 'http://laravel.com');
@@ -81,7 +82,7 @@ public function it_can_render_canonical(): void
8182
static::assertEmpty((string) $this->misc);
8283
}
8384

84-
/** @test */
85+
#[Test]
8586
public function it_can_render_robots(): void
8687
{
8788
$expected = '<meta name="robots" content="noindex, nofollow">';
@@ -95,7 +96,7 @@ public function it_can_render_robots(): void
9596
static::assertEmpty((string) $this->misc);
9697
}
9798

98-
/** @test */
99+
#[Test]
99100
public function it_can_render_links(): void
100101
{
101102
$author = 'https://plus.google.com/+AuthorProfile';
@@ -116,7 +117,7 @@ public function it_can_render_links(): void
116117
}
117118
}
118119

119-
/** @test */
120+
#[Test]
120121
public function it_can_render(): void
121122
{
122123
$robots = '<meta name="robots" content="noindex, nofollow">';
@@ -153,7 +154,7 @@ public function it_can_render(): void
153154
]), $this->misc->render());
154155
}
155156

156-
/** @test */
157+
#[Test]
157158
public function it_can_add_remove_and_reset_tags(): void
158159
{
159160
static::assertNotEmpty($this->misc->render());
@@ -218,7 +219,7 @@ public function it_can_add_remove_and_reset_tags(): void
218219
static::assertEmpty($this->misc->render());
219220
}
220221

221-
/** @test */
222+
#[Test]
222223
public function it_can_make(): void
223224
{
224225
$this->misc = MiscTags::make([

0 commit comments

Comments
 (0)