Skip to content

Commit

Permalink
Merge ccfbc84 into d480f33
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames committed Apr 21, 2016
2 parents d480f33 + ccfbc84 commit 09aa275
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
Expand Up @@ -91,7 +91,7 @@ public function initialize() {
$value = isset( $this->requestOptions['value'] ) ? $this->requestOptions['value'] : next( $params );

$property = $this->urlEncoder->decode( $property );
$value = str_replace( array( '-25' ), array( '%' ), $value );
$value = str_replace( array( '-25', '_' ), array( '%', ' ' ), $value );

$this->property = PropertyValue::makeUserProperty( $property );

Expand Down
38 changes: 38 additions & 0 deletions tests/phpunit/Integration/ByJsonScript/Fixtures/s-0002.json
Expand Up @@ -10,6 +10,10 @@
{
"name": "Example/S0002/1",
"contents": "[[Has text::S0002]]"
},
{
"name": "Example/S0002/2",
"contents": "[[Has text::foo bar]]"
}
],
"special-testcases": [
Expand All @@ -28,6 +32,40 @@
"title=\"Special:SearchByProperty/Has-20text/S0002\">+</a></span>"
]
}
},
{
"about": "#1 value to contain `_`",
"special-page": {
"page":"SearchByProperty",
"query-parameters": "",
"request-parameters":{
"property": "Has text",
"value": "foo_bar"
}
},
"expected-output": {
"to-contain": [
"Example-2FS0002-2F2",
"<small>(foo bar)</small>"
]
}
},
{
"about": "#2 value to contain ` `",
"special-page": {
"page":"SearchByProperty",
"query-parameters": "",
"request-parameters":{
"property": "Has text",
"value": "foo bar"
}
},
"expected-output": {
"to-contain": [
"Example-2FS0002-2F2",
"<small>(foo bar)</small>"
]
}
}
],
"settings": {
Expand Down
Expand Up @@ -165,6 +165,23 @@ public function pageRequestOptionsProvider() {
)
);

#8
$provider[] = array(
'',
array(
'property' => '',
'value' => 'Foo_bar',
'nearbySearchForType' => array( '_wpg' )
),
array(
'limit' => 20,
'offset' => 0,
'nearbySearch' => false,
'propertyString' => '',
'valueString' => 'Foo bar',
)
);

return $provider;
}

Expand Down

0 comments on commit 09aa275

Please sign in to comment.