@@ -10,11 +10,24 @@ class WebSiteTest extends TestCase
10
10
11
11
protected $ attributes = [
12
12
'about ' => 'The subject matter of the content. ' ,
13
- 'headline ' => 'Headline of the article . ' ,
13
+ 'headline ' => 'Headline of the website . ' ,
14
14
'image ' => 'https://og.github.com/mark/github-mark@1200x630.png ' ,
15
15
'name ' => 'The name of the item. ' ,
16
16
'url ' => 'https://schema.org/WebSite ' ,
17
+ 'publisher ' => [
18
+ 'name ' => 'Google ' ,
19
+ 'logo ' => [
20
+ '@type ' => 'ImageObject ' ,
21
+ 'url ' => 'https://google.com/logo.jpg ' ,
22
+ 'width ' => 600 ,
23
+ 'height ' => 60 ,
24
+ ]
25
+ ],
17
26
'keywords ' => 'about,headline,image,name,url ' ,
27
+ 'inLanguage ' => 'en ' ,
28
+ 'dateCreated ' => '2013-10-04T00:00 ' ,
29
+ 'dateModified ' => '2013-10-04T00:00 ' ,
30
+ 'datePublished ' => '2013-10-04T00:00 ' ,
18
31
'sameAs ' => 'https://schema.org/sameAs ' ,
19
32
];
20
33
@@ -25,9 +38,60 @@ public function shouldGetProperties()
25
38
{
26
39
$ context = $ this ->make ();
27
40
28
- $ this ->assertEquals (array_merge ([
29
- '@context ' => 'http://schema.org ' ,
30
- '@type ' => 'WebSite ' ,
31
- ], $ this ->attributes ), $ context ->getProperties ());
41
+ $ attributesPlus = $ this ->attributes ;
42
+ $ attributesPlus ['@context ' ] = 'http://schema.org ' ;
43
+ $ attributesPlus ["@type " ] = 'WebSite ' ;
44
+ $ attributesPlus ["publisher " ]["@type " ] = 'Organization ' ;
45
+
46
+ $ this ->assertEquals ($ context ->getProperties (), $ attributesPlus );
47
+ }
48
+
49
+ /**
50
+ * @test
51
+ */
52
+ public function shouldHaveHeadline ()
53
+ {
54
+ $ context = $ this ->make ();
55
+
56
+ $ this ->assertEquals ('Headline of the website. ' , $ context ->getProperty ('headline ' ));
57
+ }
58
+
59
+ /**
60
+ * @test
61
+ */
62
+ public function shouldHavePublisherObject ()
63
+ {
64
+ $ context = $ this ->make ();
65
+
66
+ $ this ->assertEquals ([
67
+ '@type ' => 'Organization ' ,
68
+ 'name ' => 'Google ' ,
69
+ 'logo ' => [
70
+ '@type ' => 'ImageObject ' ,
71
+ 'url ' => 'https://google.com/logo.jpg ' ,
72
+ 'height ' => 60 ,
73
+ 'width ' => 600 ,
74
+ ],
75
+ ], $ context ->getProperty ('publisher ' ));
76
+ }
77
+
78
+ /**
79
+ * @test
80
+ */
81
+ public function shouldHaveKeywords ()
82
+ {
83
+ $ context = $ this ->make ();
84
+
85
+ $ this ->assertEquals ('about,headline,image,name,url ' , $ context ->getProperty ('keywords ' ));
86
+ }
87
+
88
+ /**
89
+ * @test
90
+ */
91
+ public function shouldHaveInLanguage ()
92
+ {
93
+ $ context = $ this ->make ();
94
+
95
+ $ this ->assertEquals ('en ' , $ context ->getProperty ('inLanguage ' ));
32
96
}
33
97
}
0 commit comments