[4.0] Increase API Test Coverage#26722
Conversation
1234016 to
86ca4d5
Compare
30fdbee to
b5505b9
Compare
a16ca03 to
3b91dd2
Compare
|
@wilsonge Is the
|
3b91dd2 to
301f1f2
Compare
|
Honestly I don't remember. This is the second time I'd attempted this PR - the original tests date back 2-3 years. I've just rebased and pushed up which should retrigger drone |
|
@C-Lodder works fine. However you need to update the status of the article to trashed with a patch request before deleting else you get a 500 (we need to improve the error message but functionally it works) |
|
Ahh fair enough. Will give that a go. Is that approach going to be set in stone for V1 of the API? |
|
Not really. For articles I specifically skipped the check of ensuring an item was in trash for the api. Unsure whether to go with that approach or not. ( see https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/src/Model/ArticleModel.php#L301 ). |
|
I'd suggest keeping it consitent with other component APIs. |
|
Oh for sure. I more meant I hadn’t really settled on which was best |
|
I am not sure with the tests. i can run codeception tests for administor: I can not run the same for api In the readme https://github.com/joomla/joomla-cms/tree/4.0-dev/tests/Codeception#api-testing-for-joomla I read that I have to run Then I found in the file |
|
@astridx I’d imagine it’s related to the site secret ( ) - we rely on a fixed site secret so we have a consistent user token (if you look at the codeception tasks run in that bash file you probably can piece together what’s missing from the readme) |
I understood it to be possible to create a category without the |
|
ok, but then the documentation should be fixed https://docs.joomla.org/J4.x:Joomla_Core_APIs#Create_Category i wasn't able to run the test coverage suite , but i'll mark this pr as Tested successfully cause Drone is happy |
|
I have tested this item ✅ successfully on 4e4a360 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26722. |
|
Documentation fixed |
I changed the secret in my Configuration.php and now all 9 tests went through. |
|
I have tested this item ✅ successfully on 4e4a360 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26722. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26722. |
|
Thanks merged. |
…om_templates * '4.0-dev' of github.com:joomla/joomla-cms: (70 commits) [4.0] Child templates consistency (joomla#30387) [4.0] favicon changes to support child templates (joomla#30388) [4.0] Update Readme for Api tests (joomla#30539) [4.0] [Multilingual Status module] Adding displaying a possible error if URL Language Code is empty (joomla#30537) [4.0] Display of horizontal mod_articles_news module (joomla#30527) [4.0] Useless installation lang strings (joomla#30568) [4.0] Numbers not digits (joomla#30559) [4.0] Accessibility plugin position (joomla#30552) [4.0] fix for inherit fields (joomla#30557) [4.0] Redundant words (joomla#30555) add missing legend to fieldset (joomla#30528) [4.0] [a11y] add statement on found results (joomla#30535) [4.0] com_finder ul instead of dl for easier styling (joomla#30534) [4.0] Messages/Alerts: using icons instead of text as heading (joomla#30516) [4.0] Increase API Test Coverage (joomla#26722) [4.0] Implementing display of password requirements for frontend (joomla#30473) [4.0] FieldsHelper: Choose a first available category correctly (joomla#30268) Sort options (joomla#30531) Clear checkboxes on back button (joomla#30498) Update _icomoon.scss (joomla#30436) ...
* Add basic contact api tests * Fix contact delete in the API * Improve tests * Update ContactModel.php * Test for content categories * Start work on tests for banners * Move tests to bearer token approach * Fix patch banner * Fix category creation for non-content extensions * Fix delete category * Fix patch category * State => published * Don't hardcode catid for tests * Debug * Fix * Fixes * Fixes * Append string * Add catid to the update * Fix auth * Add workflow * Trash article in the update


Continues work on adding tests for our APIs in J4
Testing instructions
Try creating a category for a extension that is not com_content (contact or banners). Before patch you’ll get an error that the workflow is missing (despite banners doesn’t have workflows). After patch you can correctly create a category.
This PR also adds many api cases for banners, contacts and category api tests for content check that the api tests pass in drone