Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jun 9, 2020
1 parent b3e4997 commit 720af80
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
20 changes: 16 additions & 4 deletions tests/GlobalTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@
->image('http://www.example.com/image1.jpg');

assertMatchesHtmlSnapshot((string) $og);
})->group('global');
})->group('global', 'website');

it('can generate website tags with stringable image', function () {
$og = Website::make('Title | Example')
->url('http://www.example.com')
->description('Description')
->locale('en_US')
->alternateLocale('en_GB')
->siteName('Example')
->image(new class() { public function __toString() { return 'http://www.example.com/image1.jpg'; }});

assertMatchesHtmlSnapshot((string) $og);
})->group('global', 'website');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('global');
})->group('global', 'article');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('global');
})->group('global', 'book');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('global');
})->group('global', 'profile');
8 changes: 4 additions & 4 deletions tests/MusicTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
->album('http://www.example.com/album', 1, 4);

assertMatchesHtmlSnapshot((string) $og);
})->group('music');
})->group('music', 'song');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('music');
})->group('music', 'album');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('music');
})->group('music', 'playlist');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('music');
})->group('music', 'radio_station');
7 changes: 4 additions & 3 deletions tests/TwitterTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
->image('http://www.example.com/image1.jpg', 'Image alternate text');

assertMatchesHtmlSnapshot((string) $og);
})->group('twitter');
})->group('twitter', 'summary');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('twitter');
})->group('twitter', 'summary_large_image');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('twitter');
})->group('twitter', 'player');
8 changes: 4 additions & 4 deletions tests/VideoTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
->tag('Thriller');

assertMatchesHtmlSnapshot((string) $og);
})->group('video');
})->group('video', 'movie');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('video');
})->group('video', 'tv_show');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('video');
})->group('video', 'episode');

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

assertMatchesHtmlSnapshot((string) $og);
})->group('video');
})->group('video', 'other');
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta property="og:locale:alternate" content="en_GB">
<meta property="og:site_name" content="Example">
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
<meta property="og:image:url" content="http://www.example.com/song.mp3">
<meta property="og:audio:url" content="http://www.example.com/song.mp3">
<meta property="music:duration" content="90">
<meta property="music:musician" content="http://www.example.com/musician">
<meta property="music:album" content="http://www.example.com/album">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta property="og:locale:alternate" content="en_GB">
<meta property="og:site_name" content="Example">
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
<meta property="og:image:url" content="http://www.example.com/video.mp4">
<meta property="og:video:url" content="http://www.example.com/video.mp4">
<meta property="video:release_date" content="2020-06-05">
<meta property="video:duration" content="210">
<meta property="video:actor" content="http://www.example.com/actor">
Expand Down

0 comments on commit 720af80

Please sign in to comment.