| @@ 40-53 (lines=14) @@ | ||
| 37 | $configurator->configure($invalidGenerator); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testTitle() |
|
| 41 | { |
|
| 42 | $config = [ |
|
| 43 | 'title' => 'Awesome | Site' |
|
| 44 | ]; |
|
| 45 | ||
| 46 | $configurator = new BasicSeoConfigurator($config); |
|
| 47 | $configurator->configure($this->generator); |
|
| 48 | ||
| 49 | $this->assertEquals( |
|
| 50 | '<title>Awesome | Site</title>', |
|
| 51 | $this->generator->render() |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| @@ 55-68 (lines=14) @@ | ||
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| 57 | $config = [ |
|
| 58 | 'description' => 'My awesome site is so cool!', |
|
| 59 | ]; |
|
| 60 | ||
| 61 | $configurator = new BasicSeoConfigurator($config); |
|
| 62 | $configurator->configure($this->generator); |
|
| 63 | ||
| 64 | $this->assertEquals( |
|
| 65 | '<meta name="description" content="My awesome site is so cool!" />', |
|
| 66 | $this->generator->render() |
|
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testKeywords() |
|
| 71 | { |
|
| @@ 70-83 (lines=14) @@ | ||
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testKeywords() |
|
| 71 | { |
|
| 72 | $config = [ |
|
| 73 | 'keywords' => 'awesome, cool', |
|
| 74 | ]; |
|
| 75 | ||
| 76 | $configurator = new BasicSeoConfigurator($config); |
|
| 77 | $configurator->configure($this->generator); |
|
| 78 | ||
| 79 | $this->assertEquals( |
|
| 80 | '<meta name="keywords" content="awesome, cool" />', |
|
| 81 | $this->generator->render() |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCanonical() |
|
| 86 | { |
|
| @@ 85-98 (lines=14) @@ | ||
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCanonical() |
|
| 86 | { |
|
| 87 | $config = [ |
|
| 88 | 'canonical' => 'http://127.0.0.1:8000', |
|
| 89 | ]; |
|
| 90 | ||
| 91 | $configurator = new BasicSeoConfigurator($config); |
|
| 92 | $configurator->configure($this->generator); |
|
| 93 | ||
| 94 | $this->assertEquals( |
|
| 95 | '<link href="http://127.0.0.1:8000" rel="canonical" />', |
|
| 96 | $this->generator->render() |
|
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testRobots() |
|
| 101 | { |
|
| @@ 118-129 (lines=12) @@ | ||
| 115 | ); |
|
| 116 | } |
|
| 117 | ||
| 118 | public function testNoConfig() |
|
| 119 | { |
|
| 120 | $config = []; |
|
| 121 | ||
| 122 | $configurator = new BasicSeoConfigurator($config); |
|
| 123 | $configurator->configure($this->generator); |
|
| 124 | ||
| 125 | $this->assertEquals( |
|
| 126 | '', |
|
| 127 | $this->generator->render() |
|
| 128 | ); |
|
| 129 | } |
|
| 130 | } |
|
| 131 | ||
| @@ 40-53 (lines=14) @@ | ||
| 37 | $configurator->configure($invalidGenerator); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testTitle() |
|
| 41 | { |
|
| 42 | $config = [ |
|
| 43 | 'title' => 'Awesome | Site' |
|
| 44 | ]; |
|
| 45 | ||
| 46 | $configurator = new OgSeoConfigurator($config); |
|
| 47 | $configurator->configure($this->generator); |
|
| 48 | ||
| 49 | $this->assertEquals( |
|
| 50 | '<meta name="og:title" content="Awesome | Site" />', |
|
| 51 | $this->generator->render() |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| @@ 55-68 (lines=14) @@ | ||
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| 57 | $config = [ |
|
| 58 | 'description' => 'My awesome site is so cool!', |
|
| 59 | ]; |
|
| 60 | ||
| 61 | $configurator = new OgSeoConfigurator($config); |
|
| 62 | $configurator->configure($this->generator); |
|
| 63 | ||
| 64 | $this->assertEquals( |
|
| 65 | '<meta name="og:description" content="My awesome site is so cool!" />', |
|
| 66 | $this->generator->render() |
|
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testImage() |
|
| 71 | { |
|
| @@ 70-83 (lines=14) @@ | ||
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testImage() |
|
| 71 | { |
|
| 72 | $config = [ |
|
| 73 | 'image' => 'http://images.com/poney/12', |
|
| 74 | ]; |
|
| 75 | ||
| 76 | $configurator = new OgSeoConfigurator($config); |
|
| 77 | $configurator->configure($this->generator); |
|
| 78 | ||
| 79 | $this->assertEquals( |
|
| 80 | '<meta name="og:image" content="http://images.com/poney/12" />', |
|
| 81 | $this->generator->render() |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testType() |
|
| 86 | { |
|
| @@ 85-98 (lines=14) @@ | ||
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testType() |
|
| 86 | { |
|
| 87 | $config = [ |
|
| 88 | 'type' => 'website', |
|
| 89 | ]; |
|
| 90 | ||
| 91 | $configurator = new OgSeoConfigurator($config); |
|
| 92 | $configurator->configure($this->generator); |
|
| 93 | ||
| 94 | $this->assertEquals( |
|
| 95 | '<meta name="og:type" content="website" />', |
|
| 96 | $this->generator->render() |
|
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testNoConfig() |
|
| 101 | { |
|
| @@ 100-111 (lines=12) @@ | ||
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testNoConfig() |
|
| 101 | { |
|
| 102 | $config = []; |
|
| 103 | ||
| 104 | $configurator = new OgSeoConfigurator($config); |
|
| 105 | $configurator->configure($this->generator); |
|
| 106 | ||
| 107 | $this->assertEquals( |
|
| 108 | '', |
|
| 109 | $this->generator->render() |
|
| 110 | ); |
|
| 111 | } |
|
| 112 | } |
|
| 113 | ||
| @@ 40-53 (lines=14) @@ | ||
| 37 | $configurator->configure($invalidGenerator); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testTitle() |
|
| 41 | { |
|
| 42 | $config = [ |
|
| 43 | 'title' => 'Awesome | Site' |
|
| 44 | ]; |
|
| 45 | ||
| 46 | $configurator = new TwitterSeoConfigurator($config); |
|
| 47 | $configurator->configure($this->generator); |
|
| 48 | ||
| 49 | $this->assertEquals( |
|
| 50 | '<meta name="twitter:title" content="Awesome | Site" />', |
|
| 51 | $this->generator->render() |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| @@ 55-68 (lines=14) @@ | ||
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testDescription() |
|
| 56 | { |
|
| 57 | $config = [ |
|
| 58 | 'description' => 'My awesome site is so cool!', |
|
| 59 | ]; |
|
| 60 | ||
| 61 | $configurator = new TwitterSeoConfigurator($config); |
|
| 62 | $configurator->configure($this->generator); |
|
| 63 | ||
| 64 | $this->assertEquals( |
|
| 65 | '<meta name="twitter:description" content="My awesome site is so cool!" />', |
|
| 66 | $this->generator->render() |
|
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testImage() |
|
| 71 | { |
|
| @@ 70-83 (lines=14) @@ | ||
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function testImage() |
|
| 71 | { |
|
| 72 | $config = [ |
|
| 73 | 'image' => 'http://images.com/poney/12', |
|
| 74 | ]; |
|
| 75 | ||
| 76 | $configurator = new TwitterSeoConfigurator($config); |
|
| 77 | $configurator->configure($this->generator); |
|
| 78 | ||
| 79 | $this->assertEquals( |
|
| 80 | '<meta name="twitter:image" content="http://images.com/poney/12" />', |
|
| 81 | $this->generator->render() |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCard() |
|
| 86 | { |
|
| @@ 85-98 (lines=14) @@ | ||
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testCard() |
|
| 86 | { |
|
| 87 | $config = [ |
|
| 88 | 'card' => 'summary', |
|
| 89 | ]; |
|
| 90 | ||
| 91 | $configurator = new TwitterSeoConfigurator($config); |
|
| 92 | $configurator->configure($this->generator); |
|
| 93 | ||
| 94 | $this->assertEquals( |
|
| 95 | '<meta name="twitter:card" content="summary" />', |
|
| 96 | $this->generator->render() |
|
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testSite() |
|
| 101 | { |
|
| @@ 100-113 (lines=14) @@ | ||
| 97 | ); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function testSite() |
|
| 101 | { |
|
| 102 | $config = [ |
|
| 103 | 'site' => '@leogoutt', |
|
| 104 | ]; |
|
| 105 | ||
| 106 | $configurator = new TwitterSeoConfigurator($config); |
|
| 107 | $configurator->configure($this->generator); |
|
| 108 | ||
| 109 | $this->assertEquals( |
|
| 110 | '<meta name="twitter:site" content="@leogoutt" />', |
|
| 111 | $this->generator->render() |
|
| 112 | ); |
|
| 113 | } |
|
| 114 | ||
| 115 | public function testNoConfig() |
|
| 116 | { |
|
| @@ 115-126 (lines=12) @@ | ||
| 112 | ); |
|
| 113 | } |
|
| 114 | ||
| 115 | public function testNoConfig() |
|
| 116 | { |
|
| 117 | $config = []; |
|
| 118 | ||
| 119 | $configurator = new TwitterSeoConfigurator($config); |
|
| 120 | $configurator->configure($this->generator); |
|
| 121 | ||
| 122 | $this->assertEquals( |
|
| 123 | '', |
|
| 124 | $this->generator->render() |
|
| 125 | ); |
|
| 126 | } |
|
| 127 | } |
|
| 128 | ||