You are here

public function FeedsTamperAbsoluteURLTestCase::test in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 tests/feeds_tamper_plugins.test \FeedsTamperAbsoluteURLTestCase::test()

File

tests/feeds_tamper_plugins.test, line 66
Unit tests for feeds tamper plugins.

Class

FeedsTamperAbsoluteURLTestCase
Tests for absolute_url.inc

Code

public function test() {
  $this
    ->executeAbs('http://example.com', '<a href="dog"></a>', '<a href="http://example.com/dog"></a>');
  $this
    ->executeAbs('http://example.com/cat/chicken', '<a href="dog"></a>', '<a href="http://example.com/cat/chicken/dog"></a>');
  $this
    ->executeAbs('http://example.com/cat', '<a href="/dog"></a>', '<a href="http://example.com/dog"></a>');
  $this
    ->executeAbs('http://example.com', '<a href="/dog"></a><img src="/kitty" />', '<a href="http://example.com/dog"></a><img src="http://example.com/kitty" />');
  $this
    ->executeAbs('http://example.com', '<img src="/kitty" />', '<img src="http://example.com/kitty" />');
  $this
    ->executeAbs('http://example.com', '<img src="kitty" />', '<img src="http://example.com/kitty" />');
  $this
    ->executeAbs('http://example.com', '<img src="/kitty.png" />', '<img src="http://example.com/kitty.png" />');
  $this
    ->executeAbs('http://example.com', '<img src="/frog/kitty.png" />', '<img src="http://example.com/frog/kitty.png" />');
  $this
    ->executeAbs('http://example.com', '', '');
  $this
    ->executeAbs('http://example.com', 'sdfsdfdsf', 'sdfsdfdsf');
  $this
    ->executeAbs('http://example.com', '<a href="">asdfasdf</a>', '<a href="">asdfasdf</a>');
}