Wordpress/tests
Adam Silverstein 399db7ac03 WP-API JS Client: Add helpers to get a model or collection by route.
Add two new helper functions, `wp.api.getModelByRoute` and `wp.api.getCollectionByRoute`. Passed a route, they return the matching model or collection, or `undefined` if none is found.

Also adds tests to verify these functions work as expected.

Props rcutmore.
Fixes #41111.


git-svn-id: https://develop.svn.wordpress.org/trunk@41334 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 16:00:28 +00:00
..
phpunit Widgets: Add nudge for registered widgets 2017-09-01 08:49:50 +00:00
qunit WP-API JS Client: Add helpers to get a model or collection by route. 2017-09-04 16:00:28 +00:00