Skip to content

Commit 720af80

Browse files
committed
update tests
1 parent b3e4997 commit 720af80

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

tests/GlobalTypesTest.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@
1515
->image('http://www.example.com/image1.jpg');
1616

1717
assertMatchesHtmlSnapshot((string) $og);
18-
})->group('global');
18+
})->group('global', 'website');
19+
20+
it('can generate website tags with stringable image', function () {
21+
$og = Website::make('Title | Example')
22+
->url('http://www.example.com')
23+
->description('Description')
24+
->locale('en_US')
25+
->alternateLocale('en_GB')
26+
->siteName('Example')
27+
->image(new class() { public function __toString() { return 'http://www.example.com/image1.jpg'; }});
28+
29+
assertMatchesHtmlSnapshot((string) $og);
30+
})->group('global', 'website');
1931

2032
it('can generate article tags', function () {
2133
$og = Article::make('Article | Example')
@@ -33,7 +45,7 @@
3345
->tag('PHP');
3446

3547
assertMatchesHtmlSnapshot((string) $og);
36-
})->group('global');
48+
})->group('global', 'article');
3749

3850
it('can generate book tags', function () {
3951
$og = Book::make('Book | Example')
@@ -50,7 +62,7 @@
5062
->tag('PHP');
5163

5264
assertMatchesHtmlSnapshot((string) $og);
53-
})->group('global');
65+
})->group('global', 'book');
5466

5567
it('can generate profile tags', function () {
5668
$og = Profile::make('Profile | Example')
@@ -67,4 +79,4 @@
6779
->gender('female');
6880

6981
assertMatchesHtmlSnapshot((string) $og);
70-
})->group('global');
82+
})->group('global', 'profile');

tests/MusicTypesTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
->album('http://www.example.com/album', 1, 4);
2121

2222
assertMatchesHtmlSnapshot((string) $og);
23-
})->group('music');
23+
})->group('music', 'song');
2424

2525
it('can generate album tags', function () {
2626
$og = Album::make('Title | Example')
@@ -39,7 +39,7 @@
3939
->releasedAt(new DateTime('2020-06-05'));
4040

4141
assertMatchesHtmlSnapshot((string) $og);
42-
})->group('music');
42+
})->group('music', 'album');
4343

4444
it('can generate playlist tags', function () {
4545
$og = Playlist::make('Title | Example')
@@ -57,7 +57,7 @@
5757
->song('http://www.example.com/song4', 1, 4);
5858

5959
assertMatchesHtmlSnapshot((string) $og);
60-
})->group('music');
60+
})->group('music', 'playlist');
6161

6262
it('can generate radiostation tags', function () {
6363
$og = RadioStation::make('Title | Example')
@@ -71,4 +71,4 @@
7171
->creator('http://www.example.com/creator');
7272

7373
assertMatchesHtmlSnapshot((string) $og);
74-
})->group('music');
74+
})->group('music', 'radio_station');

tests/TwitterTypesTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
->image('http://www.example.com/image1.jpg', 'Image alternate text');
1212

1313
assertMatchesHtmlSnapshot((string) $og);
14-
})->group('twitter');
14+
})->group('twitter', 'summary');
1515

1616
it('can generate summary with large image tags', function () {
1717
$og = SummaryLargeImage::make('Title | Example')
1818
->description('Description')
1919
->site('@astrotomic_oss')
20+
->creator('@devgummibeer')
2021
->image('http://www.example.com/image1.jpg', 'Image alternate text');
2122

2223
assertMatchesHtmlSnapshot((string) $og);
23-
})->group('twitter');
24+
})->group('twitter', 'summary_large_image');
2425

2526
it('can generate player tags', function () {
2627
$og = Player::make('Title | Example')
@@ -30,4 +31,4 @@
3031
->player('http://www.example.com/player.iframe', 1920, 1080);
3132

3233
assertMatchesHtmlSnapshot((string) $og);
33-
})->group('twitter');
34+
})->group('twitter', 'player');

tests/VideoTypesTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
->tag('Thriller');
3333

3434
assertMatchesHtmlSnapshot((string) $og);
35-
})->group('video');
35+
})->group('video', 'movie');
3636

3737
it('can generate tv show tags', function () {
3838
$og = TvShow::make('Title | Example')
@@ -50,7 +50,7 @@
5050
->tag('Crime');
5151

5252
assertMatchesHtmlSnapshot((string) $og);
53-
})->group('video');
53+
})->group('video', 'tv_show');
5454

5555
it('can generate episode tags', function () {
5656
$og = Episode::make('Title | Example')
@@ -70,7 +70,7 @@
7070
->tag('Crime');
7171

7272
assertMatchesHtmlSnapshot((string) $og);
73-
})->group('video');
73+
})->group('video', 'episode');
7474

7575
it('can generate other tags', function () {
7676
$og = Other::make('Title | Example')
@@ -90,4 +90,4 @@
9090
->tag('Crime');
9191

9292
assertMatchesHtmlSnapshot((string) $og);
93-
})->group('video');
93+
})->group('video', 'other');

tests/__snapshots__/MusicTypesTest__it_can_generate_song_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
1010
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
11-
<meta property="og:image:url" content="http://www.example.com/song.mp3">
11+
<meta property="og:audio:url" content="http://www.example.com/song.mp3">
1212
<meta property="music:duration" content="90">
1313
<meta property="music:musician" content="http://www.example.com/musician">
1414
<meta property="music:album" content="http://www.example.com/album">

tests/__snapshots__/VideoTypesTest__it_can_generate_other_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
1010
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
11-
<meta property="og:image:url" content="http://www.example.com/video.mp4">
11+
<meta property="og:video:url" content="http://www.example.com/video.mp4">
1212
<meta property="video:release_date" content="2020-06-05">
1313
<meta property="video:duration" content="210">
1414
<meta property="video:actor" content="http://www.example.com/actor">

0 commit comments

Comments
 (0)