Skip to content

Commit 2fd7632

Browse files
jenkins-botGerrit Code Review
authored andcommitted
Merge "Search: Update RouteHandlersTest for v1"
2 parents 538dfbe + bd87b75 commit 2fd7632

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

repo/domains/crud/tests/phpunit/RouteHandlers/RouteHandlersTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,17 @@ class RouteHandlersTest extends MediaWikiIntegrationTestCase {
164164

165165
public static function setUpBeforeClass(): void {
166166
parent::setUpBeforeClass();
167-
$notExcluded = fn( $route ) => (
168-
str_starts_with( $route['path'], '/wikibase/v1/entities' ) ||
169-
str_starts_with( $route['path'], '/wikibase/v1/statements' )
170-
);
167+
$crudRoutes = fn( $route ) => str_starts_with( $route['path'], '/wikibase/v1/entities' )
168+
|| str_starts_with( $route['path'], '/wikibase/v1/statements' );
171169
self::$prodRoutesData = array_filter(
172170
json_decode( file_get_contents( __DIR__ . '/../../../../../../extension-repo.json' ), true )[ 'RestRoutes' ],
173-
$notExcluded
171+
$crudRoutes
174172
);
175173
self::$routesData = array_merge(
176174
self::$prodRoutesData,
177175
array_filter(
178176
json_decode( file_get_contents( __DIR__ . '/../../../../../rest-api/routes.dev.json' ), true ),
179-
$notExcluded
177+
$crudRoutes
180178
)
181179
);
182180
}

repo/domains/search/tests/phpunit/RouteHandlers/RouteHandlersTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class RouteHandlersTest extends MediaWikiIntegrationTestCase {
3333

3434
public static function setUpBeforeClass(): void {
3535
parent::setUpBeforeClass();
36-
$searchRoutes = fn( $route ) => str_starts_with( $route['path'], '/wikibase/v0' );
36+
$searchRoutes = fn( $route ) => str_starts_with( $route['path'], '/wikibase/v1/search' )
37+
|| str_starts_with( $route['path'], '/wikibase/v1/suggest' );
3738
$prodRoutes = array_filter(
3839
json_decode( file_get_contents( __DIR__ . '/../../../../../../extension-repo.json' ), true )[ 'RestRoutes' ],
3940
$searchRoutes
@@ -109,25 +110,25 @@ public static function routeHandlersProvider(): Generator {
109110
// phpcs:disable Generic.Arrays.ArrayIndent.CloseBraceNotNewLine
110111
yield 'SimpleItemSearch' => [ [
111112
'useCase' => SimpleItemSearch::class,
112-
'path' => '/wikibase/v0/search/items',
113+
'path' => '/wikibase/v1/search/items',
113114
'serviceName' => 'WbSearch.SimpleItemSearch',
114115
] ];
115116

116117
yield 'SimplePropertySearch' => [ [
117118
'useCase' => SimplePropertySearch::class,
118-
'path' => '/wikibase/v0/search/properties',
119+
'path' => '/wikibase/v1/search/properties',
119120
'serviceName' => 'WbSearch.SimplePropertySearch',
120121
] ];
121122

122123
yield 'ItemPrefixSearch' => [ [
123124
'useCase' => ItemPrefixSearch::class,
124-
'path' => '/wikibase/v0/suggest/items',
125+
'path' => '/wikibase/v1/suggest/items',
125126
'serviceName' => 'WbSearch.ItemPrefixSearch',
126127
] ];
127128

128129
yield 'PropertyPrefixSearch' => [ [
129130
'useCase' => PropertyPrefixSearch::class,
130-
'path' => '/wikibase/v0/suggest/properties',
131+
'path' => '/wikibase/v1/suggest/properties',
131132
'serviceName' => 'WbSearch.PropertyPrefixSearch',
132133
] ];
133134
}

0 commit comments

Comments
 (0)