public function test_google_utm_link() { $link = get_post_permalink($this->_post_id); $name = 'sharedate_0_' . $this->_post_id . '_tw'; $unique_link = ppp_generate_google_utm_link($link, $this->_post_id, $name); $this->assertEquals('http://example.org/?post_type=post&p=' . $this->_post_id . '&utm_source=Twitter&utm_medium=social&utm_term=test-post&utm_content=0&utm_campaign=PostPromoterPro', $unique_link); }
public function test_google_utm_links() { $link = ppp_generate_google_utm_link(get_permalink($this->_post_id), $this->_post_id, 'sharedate_1_' . $this->_post_id . '_tw'); $expected = 'http://example.org/?p=' . $this->_post_id . '&utm_source=Twitter&utm_medium=social&utm_term=test-post&utm_content=1&utm_campaign=PostPromoterPro'; $this->assertEquals($expected, $link); $link = ppp_generate_google_utm_link(get_permalink($this->_post_id), $this->_post_id, 'sharedate_1_' . $this->_post_id . '_li'); $expected = 'http://example.org/?p=' . $this->_post_id . '&utm_source=LinkedIn&utm_medium=social&utm_term=test-post&utm_content=1&utm_campaign=PostPromoterPro'; $this->assertEquals($expected, $link); $link = ppp_generate_google_utm_link(get_permalink($this->_post_id), $this->_post_id, 'sharedate_1_' . $this->_post_id . '_fb'); $expected = 'http://example.org/?p=' . $this->_post_id . '&utm_source=Facebook&utm_medium=social&utm_term=test-post&utm_content=1&utm_campaign=PostPromoterPro'; $this->assertEquals($expected, $link); }