* CSSJanus libary:
* http://code.google.com/p/cssjanus/source/browse/trunk/cssjanus_test.py
* Ported to PHP for ResourceLoader and has been extended since.
+ *
+ * @covers CSSJanus
*/
class CSSJanusTest extends MediaWikiTestCase {
/**
* @dataProvider provideTransformCases
*/
- function testTransform( $cssA, $cssB = null ) {
+ public function testTransform( $cssA, $cssB = null ) {
if ( $cssB ) {
$transformedA = CSSJanus::transform( $cssA );
/**
* @dataProvider provideTransformAdvancedCases
*/
- function testTransformAdvanced( $code, $expectedOutput, $options = array() ) {
- $swapLtrRtlInURL = isset( $options['swapLtrRtlInURL'] ) ? $options['swapLtrRtlInURL'] : false;
- $swapLeftRightInURL = isset( $options['swapLeftRightInURL'] ) ? $options['swapLeftRightInURL'] : false;
+ public function testTransformAdvanced( $code, $expectedOutput, $options = array() ) {
+ $swapLtrRtlInURL = isset( $options['swapLtrRtlInURL'] ) ?
+ $options['swapLtrRtlInURL'] : false;
+ $swapLeftRightInURL = isset( $options['swapLeftRightInURL'] ) ?
+ $options['swapLeftRightInURL'] : false;
$flipped = CSSJanus::transform( $code, $swapLtrRtlInURL, $swapLeftRightInURL );
* @dataProvider provideTransformBrokenCases
* @group Broken
*/
- function testTransformBroken( $code, $expectedOutput ) {
+ public function testTransformBroken( $code, $expectedOutput ) {
$flipped = CSSJanus::transform( $code );
$this->assertEquals( $expectedOutput, $flipped, 'Test flipping' );
'div { float: left; /* @noflip */ text-align: left; }',
'div { float: right; /* @noflip */ text-align: left; }'
),
+ array(
+ // before a *= attribute selector with multiple properties
+ '/* @noflip */ div.foo[bar*=baz] { float:left; clear: left; }'
+ ),
+ array(
+ // before a ^= attribute selector with multiple properties
+ '/* @noflip */ div.foo[bar^=baz] { float:left; clear: left; }'
+ ),
+ array(
+ // before a ~= attribute selector with multiple properties
+ '/* @noflip */ div.foo[bar~=baz] { float:left; clear: left; }'
+ ),
+ array(
+ // before a = attribute selector with multiple properties
+ '/* @noflip */ div.foo[bar=baz] { float:left; clear: left; }'
+ ),
+ array(
+ // before a quoted attribute selector with multiple properties
+ '/* @noflip */ div.foo[bar=\'baz{quux\'] { float:left; clear: left; }'
+ ),
// Guard against css3 stuff
array(