@@ -10,11 +10,24 @@ class WebSiteTest extends TestCase
1010
1111 protected $ attributes = [
1212 'about ' => 'The subject matter of the content. ' ,
13- 'headline ' => 'Headline of the article . ' ,
13+ 'headline ' => 'Headline of the website . ' ,
1414 'image ' => 'https://og.github.com/mark/github-mark@1200x630.png ' ,
1515 'name ' => 'The name of the item. ' ,
1616 '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+ ],
1726 '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 ' ,
1831 'sameAs ' => 'https://schema.org/sameAs ' ,
1932 ];
2033
@@ -25,9 +38,60 @@ public function shouldGetProperties()
2538 {
2639 $ context = $ this ->make ();
2740
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 ' ));
3296 }
3397}
0 commit comments