$showMode
];
$instance = Deserializer::deserialize( $text, $options );
$this->assertEquals(
$expectedLabel,
$instance->getLabel()
);
$this->assertEquals(
$expectedMode,
$instance->getMode()
);
if ( $expectedDataInstance !== null ) {
$this->assertInstanceOf(
$expectedDataInstance,
$instance->getData()
);
}
$this->assertSame(
$expectedOutputFormat,
$instance->getOutputFormat()
);
}
public function textProvider() {
# 0
$provider[] = [
'Foo',
false,
'Foo',
PrintRequest::PRINT_PROP,
PropertyValue::class,
''
];
# 1
$provider[] = [
'-Foo',
false,
'-Foo',
PrintRequest::PRINT_PROP,
PropertyValue::class,
''
];
# 2
$provider[] = [
'-Foo=Bar',
false,
'Bar',
PrintRequest::PRINT_PROP,
PropertyValue::class,
''
];
# 3
// Category
$categoryName = Localizer::getInstance()->getNsText(
NS_CATEGORY
);
$provider[] = [
'Category',
false,
$categoryName,
PrintRequest::PRINT_CATS,
null,
''
];
# 4
// Category
$categoryName = Localizer::getInstance()->getNsText(
NS_CATEGORY
);
$provider[] = [
'category',
false,
$categoryName,
PrintRequest::PRINT_CATS,
null,
''
];
# 5
// Category
$provider[] = [
'Categories',
false,
$categoryName,
PrintRequest::PRINT_CATS,
null,
''
];
# 6
// "... ask for one particular category ... contains X for all pages
// that directly belong to that category ..."
$label = Localizer::getInstance()->createTextWithNamespacePrefix(
NS_CATEGORY,
'Foo'
);
$provider[] = [
$label,
false,
// Label
'Foo',
// Mode
PrintRequest::PRINT_CCAT,
// DataInstance
null,
// OutputFormat
'x'
];
# 7
$provider[] = [
'Bar#foobar',
false,
'Bar',
PrintRequest::PRINT_PROP,
PropertyValue::class,
'foobar'
];
# 8
$provider[] = [
'Foo#',
false,
'Foo',
PrintRequest::PRINT_PROP,
PropertyValue::class,
'-'
];
# 9, 1464
$provider[] = [
'Has boolean#✓,✕=Label on (✓,✕)',
false,
'Label on (✓,✕)',
PrintRequest::PRINT_PROP,
PropertyValue::class,
'✓,✕'
];
# 10
$provider[] = [
'Foo.Bar',
false,
'Bar',
PrintRequest::PRINT_CHAIN,
PropertyChainValue::class,
''
];
# 11
$provider[] = [
'Foo.Bar#foobar',
false,
'Bar',
PrintRequest::PRINT_CHAIN,
PropertyChainValue::class,
'foobar'
];
# 12
$provider[] = [
'Foo = Label',
false,
'Label',
PrintRequest::PRINT_PROP,
PropertyValue::class,
''
];
# 13
$provider[] = [
'Foo#Bar = Label',
false,
'Label',
PrintRequest::PRINT_PROP,
PropertyValue::class,
'Bar'
];
# 14 #481
$provider[] = [
'#=Foo',
false,
'Foo',
PrintRequest::PRINT_THIS,
null,
''
];
# 15 #481
$provider[] = [
'#=Foo#',
false,
'Foo',
PrintRequest::PRINT_THIS,
null,
'-'
];
# 16 #481
$provider[] = [
'#=Foo#-',
false,
'Foo',
PrintRequest::PRINT_THIS,
null,
'-'
];
return $provider;
}
}