public function testAlignFilter() { $filter =
$this->filters
['filter_align'
];
$test =
function D
$input) use ($filter) { return $filter->
process($input, 'und'
);
};
// No data-align attribute.
$input = '<img src="llama.jpg" />';
$expected =
$input;
$this->
assertSame($expected,
$test($input)->
getProcessedText());
// Data-align attribute: all 3 allowed values.
$input = '<img src="llama.jpg" data-align="left" />';
$expected = '<img src="llama.jpg" class="align-left" />';
$this->
assertSame($expected,
$test($input)->
getProcessedText());
$input = '<img src="llama.jpg" data-align="center" />';
$expected = '<img src="llama.jpg" class="align-center" />';
$this->
assertSame($expected,
$test($input)->
getProcessedText());
$input = '<img src="llama.jpg" data-align="right" />';
$expected = '<img src="llama.jpg" class="align-right" />';
$this->
assertSame($expected,
$test($input)->
getProcessedText());