| @@ 113-129 (lines=17) @@ | ||
| 110 | ); |
|
| 111 | } |
|
| 112 | ||
| 113 | public function testFromResource() |
|
| 114 | { |
|
| 115 | $resource = $this->getMockBuilder(BasicSeoInterface::class)->getMock(); |
|
| 116 | ||
| 117 | $resource->method('getSeoTitle')->willReturn('Awesome site'); |
|
| 118 | $resource->method('getSeoDescription')->willReturn('My awesome site is so cool!'); |
|
| 119 | $resource->method('getSeoKeywords')->willReturn('awesome, cool'); |
|
| 120 | ||
| 121 | $this->generator->fromResource($resource); |
|
| 122 | ||
| 123 | $this->assertEquals( |
|
| 124 | "<title>Awesome site</title>\n". |
|
| 125 | "<meta name=\"description\" content=\"My awesome site is so cool!\" />\n". |
|
| 126 | "<meta name=\"keywords\" content=\"awesome, cool\" />", |
|
| 127 | $this->generator->render() |
|
| 128 | ); |
|
| 129 | } |
|
| 130 | ||
| 131 | public function testRenderNothing() |
|
| 132 | { |
|
| @@ 81-97 (lines=17) @@ | ||
| 78 | ); |
|
| 79 | } |
|
| 80 | ||
| 81 | public function testFromResource() |
|
| 82 | { |
|
| 83 | $resource = $this->getMockBuilder(OgSeoInterface::class)->getMock(); |
|
| 84 | ||
| 85 | $resource->method('getSeoTitle')->willReturn('Awesome site'); |
|
| 86 | $resource->method('getSeoDescription')->willReturn('My awesome site is so cool!'); |
|
| 87 | $resource->method('getSeoImage')->willReturn('http://images.com/poney/12'); |
|
| 88 | ||
| 89 | $this->generator->fromResource($resource); |
|
| 90 | ||
| 91 | $this->assertEquals( |
|
| 92 | "<meta name=\"og:title\" content=\"Awesome site\" />\n". |
|
| 93 | "<meta name=\"og:description\" content=\"My awesome site is so cool!\" />\n". |
|
| 94 | "<meta name=\"og:image\" content=\"http://images.com/poney/12\" />", |
|
| 95 | $this->generator->render() |
|
| 96 | ); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function testRenderNothing() |
|
| 100 | { |
|
| @@ 91-107 (lines=17) @@ | ||
| 88 | ); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testFromResource() |
|
| 92 | { |
|
| 93 | $resource = $this->getMockBuilder(TwitterSeoInterface::class)->getMock(); |
|
| 94 | ||
| 95 | $resource->method('getSeoTitle')->willReturn('Awesome site'); |
|
| 96 | $resource->method('getSeoDescription')->willReturn('My awesome site is so cool!'); |
|
| 97 | $resource->method('getSeoImage')->willReturn('http://images.com/poney/12'); |
|
| 98 | ||
| 99 | $this->generator->fromResource($resource); |
|
| 100 | ||
| 101 | $this->assertEquals( |
|
| 102 | "<meta name=\"twitter:title\" content=\"Awesome site\" />\n". |
|
| 103 | "<meta name=\"twitter:description\" content=\"My awesome site is so cool!\" />\n". |
|
| 104 | "<meta name=\"twitter:image\" content=\"http://images.com/poney/12\" />", |
|
| 105 | $this->generator->render() |
|
| 106 | ); |
|
| 107 | } |
|
| 108 | ||
| 109 | public function testRenderNothing() |
|
| 110 | { |
|