Skip to content

Commit ba32c13

Browse files
committed
adjust tests
1 parent 296d880 commit ba32c13

17 files changed

+37
-17
lines changed

tests/GlobalTypesTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Astrotomic\OpenGraph\StructuredProperties\Audio;
34
use Astrotomic\OpenGraph\Types\Article;
45
use Astrotomic\OpenGraph\Types\Book;
56
use Astrotomic\OpenGraph\Types\Profile;
@@ -68,6 +69,10 @@ public function __toString()
6869
->alternateLocale('en_GB')
6970
->siteName('Example')
7071
->image('http://www.example.com/image1.jpg')
72+
->audio(
73+
Audio::make('http://www.example.com/audio.mp3')
74+
->mimeType('audio/mp3')
75+
)
7176

7277
->publishedAt(new DateTime('2020-06-05 20:00:00'))
7378
->modifiedAt(new DateTime('2020-06-07 20:00:00'))

tests/VideoTypesTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use Astrotomic\OpenGraph\StructuredProperties\Image;
4+
use Astrotomic\OpenGraph\StructuredProperties\Video;
45
use Astrotomic\OpenGraph\Types\Video\Episode;
56
use Astrotomic\OpenGraph\Types\Video\Movie;
67
use Astrotomic\OpenGraph\Types\Video\Other;
@@ -21,6 +22,7 @@
2122
->mimeType('image/jpg')
2223
->alt('Movie Wallpaper')
2324
)
25+
->video('http://www.example.com/trailer.mp4')
2426

2527
->releasedAt(new DateTime('2020-06-05'))
2628
->actor('http://www.example.com/actor1', 'role1')
@@ -80,7 +82,13 @@
8082
->alternateLocale('en_GB')
8183
->siteName('Example')
8284
->image('http://www.example.com/image1.jpg')
83-
->video('http://www.example.com/video.mp4')
85+
->video(
86+
Video::make('http://www.example.com/video.mp4')
87+
->width(1920)
88+
->height(1080)
89+
->mimeType('video/mp4')
90+
->alt('Movie Wallpaper')
91+
)
8492

8593
->releasedAt(new DateTime('2020-06-05'))
8694
->duration(60 * 3.5)

tests/__snapshots__/GlobalTypesTest__it_can_generate_article_tags__1.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
11+
<meta property="og:audio:url" content="http://www.example.com/audio.mp3">
12+
<meta property="og:audio:type" content="audio/mp3">
1113
<meta property="article:published_time" content="2020-06-05T20:00:00+0000">
1214
<meta property="article:modified_time" content="2020-06-07T20:00:00+0000">
1315
<meta property="article:author" content="http://www.example.com/author">

tests/__snapshots__/GlobalTypesTest__it_can_generate_book_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
<meta property="book:release_date" content="2020-06-05">
1212
<meta property="book:isbn" content="978-3-86680-192-9">
1313
<meta property="book:author" content="http://www.example.com/author">

tests/__snapshots__/GlobalTypesTest__it_can_generate_profile_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
<meta property="profile:first_name" content="Jane">
1212
<meta property="profile:last_name" content="Doe">
1313
<meta property="profile:username" content="janedoe">

tests/__snapshots__/GlobalTypesTest__it_can_generate_website_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
</head></html>

tests/__snapshots__/GlobalTypesTest__it_can_generate_website_tags_with_conditional_callbacks__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
</head></html>

tests/__snapshots__/GlobalTypesTest__it_can_generate_website_tags_with_conditional_proxies__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
</head></html>

tests/__snapshots__/GlobalTypesTest__it_can_generate_website_tags_with_stringable_image__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
</head></html>

tests/__snapshots__/MusicTypesTest__it_can_generate_album_tags__1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta property="og:locale" content="en_US">
88
<meta property="og:locale:alternate" content="en_GB">
99
<meta property="og:site_name" content="Example">
10-
<meta property="og:image:url" content="http://www.example.com/image1.jpg">
10+
<meta property="og:image" content="http://www.example.com/image1.jpg">
1111
<meta property="music:musician" content="http://www.example.com/musician">
1212
<meta property="music:song" content="http://www.example.com/song1">
1313
<meta property="music:song:disc" content="1">

0 commit comments

Comments
 (0)