Skip to content

Wire Wikidata web routes and add feature tests#7

Open
ayoungco wants to merge 1 commit intomainfrom
codex/implement-web-server-per-documentation
Open

Wire Wikidata web routes and add feature tests#7
ayoungco wants to merge 1 commit intomainfrom
codex/implement-web-server-per-documentation

Conversation

@ayoungco
Copy link
Copy Markdown
Owner

Motivation

  • Wire the existing Wikidata controllers into the app routing so concept pages are reachable under a clear namespace and do not collide with local UUID routes.
  • Provide quick, documented proof-of-concept routes for entity pages and typed lists per the Wikidata backend plan.
  • Add route-level coverage to prevent regressions and to validate controller behavior without hitting live Wikidata in tests.

Description

  • Added a /wd route group in routes/web.php and imported WikidataThingController and WikidataTypeController, exposing GET /wd/item/{qid} and GET /wd/type/{type} with input validation and named routes.
  • Introduced tests/Feature/WikidataRoutesTest.php which binds a mocked App\Services\Wikidata instance and asserts entity rendering, type listing, and unsupported-type 404 handling.
  • Tests use Mockery to stub entityBasics and sparql responses so controller + view behavior is validated without network calls.

Testing

  • Ran php -l routes/web.php which reported no syntax errors.
  • Ran php -l tests/Feature/WikidataRoutesTest.php which reported no syntax errors.
  • Attempted php artisan test tests/Feature/WikidataRoutesTest.php but it was blocked in this environment due to a missing vendor/autoload.php so the feature test suite could not be executed here.

Codex Task

@ayoungco
Copy link
Copy Markdown
Owner Author

Not necessary but want to eventually move to some unified/open data model. Give back to the community and all that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant