? ? Pending

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
19 Oct 2019

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

avatar wilsonge wilsonge - open - 19 Oct 2019
avatar wilsonge wilsonge - change - 19 Oct 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Oct 2019
Category Unit Tests
avatar wilsonge wilsonge - change - 19 Oct 2019
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 19 Oct 2019
Category Unit Tests Administration com_contact Unit Tests
avatar joomla-cms-bot joomla-cms-bot - change - 3 Feb 2020
Category Unit Tests Administration com_contact Unit Tests
avatar wilsonge wilsonge - change - 3 Feb 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 3 Feb 2020
The description was changed
avatar wilsonge wilsonge - edited - 3 Feb 2020
avatar C-Lodder
C-Lodder - comment - 24 Aug 2020

@wilsonge Is the DELETE method working for you? Drone is showing a 404 so I can't see the results of the PR, but when testing via JS, I'm getting:

500 - Internal server error

avatar wilsonge wilsonge - change - 25 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge
wilsonge - comment - 25 Aug 2020

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

avatar wilsonge wilsonge - change - 25 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 25 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
a0aff49 27 Aug 2020 avatar wilsonge Debug
avatar wilsonge wilsonge - change - 27 Aug 2020
Labels Added: ?
Removed: ?
287cffb 28 Aug 2020 avatar wilsonge Fix
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
419791f 28 Aug 2020 avatar wilsonge Fixes
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
3924dca 28 Aug 2020 avatar wilsonge Fixes
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge
wilsonge - comment - 28 Aug 2020

@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)

avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar C-Lodder
C-Lodder - comment - 28 Aug 2020

Ahh fair enough. Will give that a go.

Is that approach going to be set in stone for V1 of the API?

avatar wilsonge wilsonge - change - 28 Aug 2020
Labels Added: ?
Removed: ?
avatar wilsonge
wilsonge - comment - 28 Aug 2020

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 ).

avatar wilsonge wilsonge - change - 28 Aug 2020
The description was changed
avatar wilsonge wilsonge - edited - 28 Aug 2020
avatar C-Lodder
C-Lodder - comment - 28 Aug 2020

I'd suggest keeping it consitent with other component APIs.

avatar wilsonge
wilsonge - comment - 28 Aug 2020

Oh for sure. I more meant I hadn’t really settled on which was best

avatar astridx
astridx - comment - 28 Aug 2020

I have tested this. Creating a category was fine for com_banners and for one of my own components. The picture shows. On branch 4.0-dev i get the error. The same query was successful on the branch of this PR.
Screenshot from 2020 08 28 21 26 11

avatar astridx
astridx - comment - 28 Aug 2020

I am not sure with the tests.

i can run codeception tests for administor:


/var/www/html/joomla-cms4$ libraries/vendor/bin/codecept run acceptance tests/Codeception/acceptance/administrator/
Codeception PHP Testing Framework v4.1.6
Powered by PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
Running with seed: 


Acceptance Tests (39) ----------------------------------------------------------------------------------------------------------
✔ ContentCategoryListCest: Category (8.94s)
✔ ContentFieldListCest: Field (13.49s)
✔ ContentListCest: Test that it loads without php notices and warnings. (0.95s)
✔ ContentListCest: Test that it is possible to create a new articles using "new" toolbar button. (44.05s)
✔ MediaListCest: Test that it loads without php notices and warnings. (0.80s)
✔ MediaListCest: Test that it shows the joomla default media files and folders. (1.39s)
✔ MediaListCest: Test that it shows the  media files and folders of a subdirectory when opened using deep link. (1.44s)
✔ MediaListCest: Test that it is possible to select a single file (1.29s)
✔ MediaListCest: Test that it is possible to select a single folder (1.03s)
✔ MediaListCest: Test that it is possible to select multiple (1.27s)
✔ MediaListCest: Test that it is possible to navigate to a subfolder using double click. (2.50s)
✔ MediaListCest: Test that it is possible to navigate to a subfolder using tree. (2.45s)
✔ MediaListCest: Test that it is possible to navigate to a subfolder using breadcrumb. (2.24s)
✔ MediaListCest: Test the upload of a single file using toolbar button. (8.45s)
S MediaListCest: Test that it shows a confirmation dialog when uploading existing file. 
✔ MediaListCest: Test that it is possible to create a new folder using the toolbar button. (4.00s)
S MediaListCest: Test that it is not possible to create an existing folder. 
✔ MediaListCest: Test that it is possible to delete a single file. (6.33s)
✔ MediaListCest: Test that it is possible to delete a single folder. (3.58s)
✔ MediaListCest: Test that it is possible to delete multiple files. (32.63s)
✔ MediaListCest: Test that it is possible to rename a file. (4.74s)
S MediaListCest: Test that it is not possible to rename a file to a filename of an existing file. 
✔ MediaListCest: Test that it is possible to rename a folder. (4.37s)
S MediaListCest: Test that it is not possible to rename a folder to a foldername of an existing folder. 
✔ MediaListCest: Test that it shows a preview for image when user doubleclicks it. (1.53s)
✔ MediaListCest: Test that it is possible to show a preview of an image using button in action menu. (2.01s)
✔ MediaListCest: Test that it is possible to close the preview modal using the close button. (2.24s)
✔ MediaListCest: Test that it is possible to close the preview modal using escape key. (2.22s)
✔ MediaListCest: Test that it is possible to open the image editor using action menu. (1.83s)
✔ MediaListCest: Test that it is possible to toggle the infobar. (0.98s)
✔ MediaListCest: Test that it shows basic file information in the infobar. (1.61s)
✔ MediaListCest: Test that it shows basic folder information in the infobar. (1.63s)
✔ MediaListCest: Test that it is possible to resize the thumbnails. (1.85s)
✔ MediaListCest: Test that it is possible to toggle the list view (grid/table) using the toolbar button. (1.44s)
✔ MediaListCest: Test that it is possible to select all items using toolbar button. (1.41s)
✔ MediaListCest: Test that the application state is synchronized with session storage. (2.46s)
✔ MenuCest: Create new menu (4.74s)
✔ UserListCest: Create user (7.23s)
✔ UserListCest: Edit user (5.73s)
--------------------------------------------------------------------------------------------------------------------------------


Time: 3.11 minutes, Memory: 16.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 39, Assertions: 213, Skipped: 4.

I can not run the same for api

/var/www/html/joomla-cms4$ libraries/vendor/bin/codecept run acceptance tests/Codeception/api/
Codeception PHP Testing Framework v4.1.6
Powered by PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
Running with seed: 


Acceptance Tests (9) -----------------------------------------------------------------------------------------------------------
- BasicCest: Test wrong credentialsPHP Fatal error:  Trait '_generated\ApiTesterActions' not found in /var/www/html/joomla-cms4/tests/Codeception/_support/ApiTester.php on line 31
PHP Stack trace:
PHP   1. {main}() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/codecept:0
PHP   2. require() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/codecept:7
PHP   3. {closure:/var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/app.php:7-47}() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/app.php:47
PHP   4. Codeception\Application->run() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/app.php:46
PHP   5. Codeception\Application->run() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Application.php:117
PHP   6. Codeception\Application->doRun() /var/www/html/joomla-cms4/libraries/vendor/symfony/console/Application.php:140
PHP   7. Codeception\Application->doRunCommand() /var/www/html/joomla-cms4/libraries/vendor/symfony/console/Application.php:264
PHP   8. Codeception\Command\Run->run() /var/www/html/joomla-cms4/libraries/vendor/symfony/console/Application.php:911
PHP   9. Codeception\Command\Run->execute() /var/www/html/joomla-cms4/libraries/vendor/symfony/console/Command/Command.php:258
PHP  10. Codeception\Codecept->run() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Command/Run.php:391
PHP  11. Codeception\Codecept->runSuite() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Codecept.php:163
PHP  12. Codeception\SuiteManager->run() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Codecept.php:196
PHP  13. Codeception\PHPUnit\Runner->doEnhancedRun() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/SuiteManager.php:161
PHP  14. Codeception\Suite->run() /var/www/html/joomla-cms4/libraries/vendor/codeception/phpunit-wrapper/src/Runner.php:117
PHP  15. Codeception\Test\Cest->run() /var/www/html/joomla-cms4/libraries/vendor/phpunit/phpunit/src/Framework/TestSuite.php:597
PHP  16. Codeception\Test\Cest->test() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Test/Test.php:98
PHP  17. Codeception\Test\Cest->executeHook() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Test/Cest.php:80
PHP  18. Codeception\Test\Cest->invoke() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Test/Cest.php:97
PHP  19. Codeception\Lib\Di->injectDependencies() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Test/Cest.php:138
PHP  20. Codeception\Lib\Di->prepareArgs() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Lib/Di.php:113
PHP  21. ReflectionParameter->getClass() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Lib/Di.php:141
PHP  22. spl_autoload_call() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Lib/Di.php:141
PHP  23. Codeception\Util\Autoload::load() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Lib/Di.php:141
PHP  24. Codeception\Util\Autoload::load() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Util/Autoload.php:97
PHP  25. Codeception\Util\Autoload::loadMappedFile() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Util/Autoload.php:86
PHP  26. Codeception\Util\Autoload::requireFile() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Util/Autoload.php:132
PHP  27. require_once() /var/www/html/joomla-cms4/libraries/vendor/codeception/codeception/src/Codeception/Util/Autoload.php:143



FATAL ERROR. TESTS NOT FINISHED.
Trait '_generated\ApiTesterActions' not found 
in /var/www/html/joomla-cms4/tests/Codeception/_support/ApiTester.php:31

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 vendor/bin/codecept run api. But that's wrong, right? I can not find the folder vendor/bin/codecept.

Then I found in the file https://github.com/joomla/joomla-cms/blob/d8930208814fb52c0871853cfd9298f70998fd1f/.drone.yml#L189 that api test are run via tests/Codeception/drone-api-run.sh. So i tried the following where Test crud on banner failed. But that's probably only due to the password, which is different in my installation.



/var/www/html/joomla-cms4$ php libraries/vendor/bin/codecept run api --fail-fast --steps --debug
Codeception PHP Testing Framework v4.1.6
Powered by PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
Running with seed: 


  [Connecting To Db] {"config":{"populate":false,"cleanup":false,"reconnect":false,"waitlock":0,"dump":null,"populator":null,"dsn":"mysql:host=localhost;dbname=joomla_db","user":"root","password":"mypassword","prefix":"c4in8_"},"options":[]}
  [Db] Connected to default joomla_db

Api Tests (9) --------------------------------------------------------------------------------------------------------------------------------
Modules: \Helper\JoomlaDb, \Helper\Api, REST, PhpBrowser
----------------------------------------------------------------------------------------------------------------------------------------------
BasicCest: Test wrong credentials
Signature: BasicCest:testWrongCredentials
Test: tests/Codeception/api/BasicCest.php:testWrongCredentials
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.enabled","profile_value":1}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.token","profile_value":"dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhU...}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "BADTOKEN"
 I have http header "Accept","application/vnd.api+json"
 I send get "/content/article/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Request Headers] {"Authorization":"Bearer BADTOKEN","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 401
  [Request Cookies] []
  [Response Headers] {"Date":["Fri, 28 Aug 2020 20:30:08 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Fri, 28 Aug 2020 20:30:08 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["34"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"errors":[{"title":"Forbidden"}]}
 I see response code is 401
 PASSED 

BasicCest: Test content negotation
Signature: BasicCest:testContentNegotation
Test: tests/Codeception/api/BasicCest.php:testContentNegotation
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.enabled","profile_value":1}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.token","profile_value":"dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhU...}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ=="
 I have http header "Accept","text/xml"
 I send get "/content/article/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Accept":"text/xml"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 406
  [Request Cookies] []
  [Response Headers] {"Date":["Fri, 28 Aug 2020 20:30:08 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Fri, 28 Aug 2020 20:30:08 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["29"],"Content-Type":["text/html; charset=utf-8"]}
  [Response] Could not match accept header
 I see response code is 406
 PASSED 

BasicCest: Test route not found
Signature: BasicCest:testRouteNotFound
Test: tests/Codeception/api/BasicCest.php:testRouteNotFound
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.enabled","profile_value":1}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.token","profile_value":"dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhU...}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ=="
 I have http header "Accept","application/vnd.api+json"
 I send get "/not/existing/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/not/existing/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/not/existing/1
  [Response] 404
  [Request Cookies] []
  [Response Headers] {"Date":["Fri, 28 Aug 2020 20:30:08 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Fri, 28 Aug 2020 20:30:08 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["54"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"errors":[{"title":"Resource not found","code":404}]}
 I see response code is 404
 PASSED 

BannerCest: Test crud on banner
Signature: BannerCest:testCrudOnBanner
Test: tests/Codeception/api/com_banners/BannerCest.php:testCrudOnBanner
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.enabled","profile_value":1}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken.token","profile_value":"dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhU...}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ=="
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/banners",{"name":"My Custom Advert","catid":3,"description":"","custombannercode":"","metakey":"","params":{"imageurl":"","...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/banners {"name":"My Custom Advert","catid":3,"description":"","custombannercode":"","metakey":"","params":{"imageurl":"","width":"","height":"","alt":""}}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners
  [Response] 401
  [Request Cookies] []
  [Response Headers] {"Date":["Fri, 28 Aug 2020 20:30:08 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Fri, 28 Aug 2020 20:30:08 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["34"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"errors":[{"title":"Forbidden"}]}
 I see response code is 200
 FAIL 

----------------------------------------------------------------------------------------------------------------------------------------------


Time: 679 ms, Memory: 14.00 MB

There was 1 failure:

---------
1) BannerCest: Test crud on banner
 Test  tests/Codeception/api/com_banners/BannerCest.php:testCrudOnBanner
 Step  See response code is 200
 Fail  Expected HTTP Status Code: 200 (OK). Actual Status Code: 401 (Unauthorized)
Failed asserting that 401 matches expected 200.

Scenario Steps:

 9. $I->seeResponseCodeIs(200) at tests/Codeception/api/com_banners/BannerCest.php:88
 8. $I->sendPOST("/banners",{"name":"My Custom Advert","catid":3,"description":"","custombannercode":"","metakey":"","params":{"imageurl"...}) at tests/Codeception/api/com_banners/BannerCest.php:86
 7. $I->haveHttpHeader("Accept","application/vnd.api+json") at tests/Codeception/api/com_banners/BannerCest.php:70
 6. $I->haveHttpHeader("Content-Type","application/json") at tests/Codeception/api/com_banners/BannerCest.php:69
 5. $I->amBearerAuthenticated("c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==") at tests/Codeception/api/com_banners/BannerCest.php:68
 4. $I->haveInDatabase("user_profiles",{"user_id":3,"profile_key":"joomlatoken.token","profile_value":"dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf...}) at tests/Codeception/api/com_banners/BannerCest.php:39

Artifacts:

Body: {"errors":[{"title":"Forbidden"}]}
Html: /var/www/html/joomla-cms4/tests/Codeception/_output/BannerCest.testCrudOnBanner.fail.html
Response: /var/www/html/joomla-cms4/tests/Codeception/_output/BannerCest.testCrudOnBanner.fail.html

FAILURES!
Tests: 4, Assertions: 4, Failures: 1.
  [Db] Disconnected from default
avatar wilsonge
wilsonge - comment - 28 Aug 2020

@astridx I’d imagine it’s related to the site secret (

# If you have found this line failing on OSX you need to brew install gnu-sed like we mentioned in the codeception readme!
) - 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)

avatar alikon
alikon - comment - 29 Aug 2020

i was able to create a category for com_banners without this pr
Screenshot from 2020-08-29 09-29-21

avatar astridx
astridx - comment - 29 Aug 2020

i was able to create a category for com_banners without this pr

I understood it to be possible to create a category without the workflow_id parameter, since workflow doesn't exist in com_banners?

avatar wilsonge
wilsonge - comment - 30 Aug 2020

@alikon exactly what @astridx says - the form required a workflow (because the com_content JForm instance is loaded rather than com_banners). Remove the params -> workflow id param from your query there and try again

avatar alikon
alikon - comment - 31 Aug 2020

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

avatar alikon alikon - test_item - 31 Aug 2020 - Tested successfully
avatar alikon
alikon - comment - 31 Aug 2020

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.

avatar wilsonge
wilsonge - comment - 31 Aug 2020

Documentation fixed

avatar astridx
astridx - comment - 1 Sep 2020

@astridx I’d imagine it’s related to the site secret (

# If you have found this line failing on OSX you need to brew install gnu-sed like we mentioned in the codeception readme!

) - 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 changed the secret in my Configuration.php and now all 9 tests went through.

libraries/vendor/bin/codecept run api --fail-fast --steps --debug
q 
Codeception PHP Testing Framework v4.1.6
Powered by PHPUnit 8.5.8 by Sebastian Bergmann and contributors.
Running with seed: 


  [Connecting To Db] {"config":{"populate":false,"cleanup":false,"reconnect":false,"waitlock":0,"dump":null,"populator":null,"dsn":"mysql:host=localhost;dbname=joomla_db","user":"root","password":"Schweden1!","prefix":"c4in8_"},"options":[]}
  [Db] Connected to default joomla_db

Api Tests (9) ------------------------------------------------------------------
Modules: \Helper\JoomlaDb, \Helper\Api, REST, PhpBrowser
--------------------------------------------------------------------------------
BasicCest: Test wrong credentials
Signature: BasicCest:testWrongCredentials
Test: tests/Codeception/api/BasicCest.php:testWrongCredentials
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "BADTOKEN"
 I have http header "Accept","application/vnd.api+json"
 I send get "/content/article/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Request Headers] {"Authorization":"Bearer BADTOKEN","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 401
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:31 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:32 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["34"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"errors":[{"title":"Forbidden"}]}
 I see response code is 401
 PASSED 

BasicCest: Test content negotation
Signature: BasicCest:testContentNegotation
Test: tests/Codeception/api/BasicCest.php:testContentNegotation
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","text/xml"
 I send get "/content/article/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Accept":"text/xml"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 406
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:32 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:32 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["29"],"Content-Type":["text/html; charset=utf-8"]}
  [Response] Could not match accept header
 I see response code is 406
 PASSED 

BasicCest: Test route not found
Signature: BasicCest:testRouteNotFound
Test: tests/Codeception/api/BasicCest.php:testRouteNotFound
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/not/existing/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/not/existing/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/not/existing/1
  [Response] 404
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:32 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:32 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["54"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"errors":[{"title":"Resource not found","code":404}]}
 I see response code is 404
 PASSED 

BannerCest: Test crud on banner
Signature: BannerCest:testCrudOnBanner
Test: tests/Codeception/api/com_banners/BannerCest.php:testCrudOnBanner
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/banners",{"name":"My Custom Advert","catid":3,"description":"...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/banners {"name":"My Custom Advert","catid":3,"description":"","custombannercode":"","metakey":"","params":{"imageurl":"","width":"","height":"","alt":""}}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:32 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:33 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["777"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/banners"},"data":{"type":"banners","id":"1","attributes":{"typeAlias":"com_banners.banner","id":1,"cid":0,"type":0,"name":"My Custom Advert","alias":"my-custom-advert","imptotal":0,"impmade":0,"clicks":0,"clickurl":"","state":0,"catid":3,"description":"","custombannercode":"","sticky":0,"ordering":1,"metakey":"","params":{"imageurl":"","width":"","height":"","alt":""},"own_prefix":0,"metakey_prefix":"","purchase_type":-1,"track_clicks":-1,"track_impressions":-1,"checked_out":null,"checked_out_time":null,"publish_up":null,"publish_down":null,"reset":null,"created":"2020-09-01 09:51:32","language":"","created_by":3,"created_by_alias":"","modified":"2020-09-01 09:51:32","modified_by":3,"version":1}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/banners/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/banners/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:33 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:33 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["780"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/banners/1"},"data":{"type":"banners","id":"1","attributes":{"typeAlias":"com_banners.banner","id":1,"cid":0,"type":0,"name":"My Custom Advert","alias":"my-custom-advert","imptotal":0,"impmade":0,"clicks":0,"clickurl":"","state":0,"catid":3,"description":"","custombannercode":"","sticky":0,"ordering":1,"metakey":"","params":{"imageurl":"","width":"","height":"","alt":""},"own_prefix":0,"metakey_prefix":"","purchase_type":-1,"track_clicks":-1,"track_impressions":-1,"checked_out":null,"checked_out_time":null,"publish_up":null,"publish_down":null,"reset":null,"created":"2020-09-01 09:51:32","language":"","created_by":3,"created_by_alias":"","modified":"2020-09-01 09:51:32","modified_by":3,"version":1}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/banners/1",{"name":"Different Custom Advert","state":-2,"cat...}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/banners/1 {"name":"Different Custom Advert","state":-2,"catid":3}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:33 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:33 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/banners/1"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/banners/1 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/1
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:33 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:33 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

BannerCest: Test crud on category
Signature: BannerCest:testCrudOnCategory
Test: tests/Codeception/api/com_banners/BannerCest.php:testCrudOnCategory
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/banners/categories",{"title":"A test category","parent_id":3}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/banners/categories {"title":"A test category","parent_id":3}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/categories
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:33 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:34 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["383"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/banners/categories"},"data":{"type":"categories","id":"9","attributes":{"parent_id":3,"level":2,"lft":4,"rgt":5,"alias":"a-test-category","id":9,"extension":"com_banners","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I grab data from response by json path "$.data.id"
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/banners/categories/9"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:34 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:34 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["386"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9"},"data":{"type":"categories","id":"9","attributes":{"parent_id":3,"level":2,"lft":4,"rgt":5,"alias":"a-test-category","id":9,"extension":"com_banners","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/banners/categories/9",{"title":"Another Title","published":-2}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9 {"title":"Another Title","published":-2}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:34 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:34 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/banners/categories/9"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/banners/categories/9
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:34 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:34 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

ContactCest: Test crud on contact
Signature: ContactCest:testCrudOnContact
Test: tests/Codeception/api/com_contact/ContactCest.php:testCrudOnContact
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/contact",{"alias":"contact-the-ceo","catid":4,"language":"*",...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/contact {"alias":"contact-the-ceo","catid":4,"language":"*","name":"Francine Blogs"}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:35 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:35 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["231"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/contact"},"data":{"type":"contacts","id":"1","attributes":{"id":1,"name":"Francine Blogs","alias":"contact-the-ceo","catid":4,"created":"2020-09-01 09:51:35"}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/contact/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/contact/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:35 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:35 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["234"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/contact/1"},"data":{"type":"contacts","id":"1","attributes":{"id":1,"name":"Francine Blogs","alias":"contact-the-ceo","catid":4,"created":"2020-09-01 09:51:35"}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/contact/1",{"name":"Frankie Blogs","catid":4,"published":-2}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/contact/1 {"name":"Frankie Blogs","catid":4,"published":-2}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:35 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:36 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/contact/1"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/contact/1 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/1
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:36 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:36 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

ContactCest: Test crud on category
Signature: ContactCest:testCrudOnCategory
Test: tests/Codeception/api/com_contact/ContactCest.php:testCrudOnCategory
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/contact/categories",{"title":"A test category","parent_id":4,...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/contact/categories {"title":"A test category","parent_id":4,"params":{"workflow_id":"inherit"}}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/categories
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:36 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:36 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["385"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/contact/categories"},"data":{"type":"categories","id":"10","attributes":{"parent_id":4,"level":2,"lft":6,"rgt":7,"alias":"a-test-category","id":10,"extension":"com_contact","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I grab data from response by json path "$.data.id"
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/contact/categories/10"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:36 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:36 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["389"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10"},"data":{"type":"categories","id":"10","attributes":{"parent_id":4,"level":2,"lft":6,"rgt":7,"alias":"a-test-category","id":10,"extension":"com_contact","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/contact/categories/10",{"title":"Another Title","published":-2}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10 {"title":"Another Title","published":-2}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:36 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:37 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/contact/categories/10"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/contact/categories/10
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:37 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:37 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

ContentCest: Test crud on article
Signature: ContentCest:testCrudOnArticle
Test: tests/Codeception/api/com_content/ContentCest.php:testCrudOnArticle
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/content/article",{"title":"Just for you","catid":2,"articlete...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/content/article {"title":"Just for you","catid":2,"articletext":"A dummy article to save to the database","language":"*","alias":"tobias"}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:37 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:38 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["748"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/content/article"},"data":{"type":"articles","id":"1","attributes":{"typeAlias":"com_content.article","id":1,"asset_id":97,"title":"Just for you","alias":"tobias","state":0,"created":"2020-09-01 09:51:37","created_by":3,"created_by_alias":"","modified":"2020-09-01 09:51:37","modified_by":3,"publish_up":null,"publish_down":null,"images":[],"urls":[],"version":1,"metakey":"","metadesc":"","access":1,"hits":0,"metadata":[],"featured":0,"language":"*","note":"","tags":[],"featured_up":null,"featured_down":null,"text":"A dummy article to save to the database "},"relationships":{"category":{"data":{"type":"categories","id":"2"}},"author":{"data":{"type":"users","id":"3"}}}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/content/article/1"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:38 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:38 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["751"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/content/article/1"},"data":{"type":"articles","id":"1","attributes":{"typeAlias":"com_content.article","id":1,"asset_id":97,"title":"Just for you","alias":"tobias","state":0,"created":"2020-09-01 09:51:37","created_by":3,"created_by_alias":"","modified":"2020-09-01 09:51:37","modified_by":3,"publish_up":null,"publish_down":null,"images":[],"urls":[],"version":1,"metakey":"","metadesc":"","access":1,"hits":0,"metadata":[],"featured":0,"language":"*","note":"","tags":[],"featured_up":null,"featured_down":null,"text":"A dummy article to save to the database "},"relationships":{"category":{"data":{"type":"categories","id":"2"}},"author":{"data":{"type":"users","id":"3"}}}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/content/article/1",{"title":"Another Title","catid":2}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/content/article/1 {"title":"Another Title","catid":2}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:38 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:38 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/content/article/1"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/content/article/1 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/article/1
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:38 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:38 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

ContentCest: Test crud on category
Signature: ContentCest:testCrudOnCategory
Test: tests/Codeception/api/com_content/ContentCest.php:testCrudOnCategory
Scenario --
 I update in database "users",{"id":3},[]
  [Query] UPDATE `c4in8_users` SET `id` = ? 
  [Parameters] [3]
 I update in database "user_usergroup_map",{"user_id":3},[]
  [Query] UPDATE `c4in8_user_usergroup_map` SET `user_id` = ? 
  [Parameters] [3]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.enabled",1]
 I have in database "user_profiles",{"user_id":3,"profile_key":"joomlatoken....}
  [Query] INSERT INTO `c4in8_user_profiles` (`user_id`, `profile_key`, `profile_value`) VALUES (?, ?, ?)
  [Parameters] [3,"joomlatoken.token","dOi2m1NRrnBHlhaWK/WWxh3B5tqq1INbdf4DhUmYTI4="]
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send post "/content/categories",{"title":"A test category","parent_id":2,...}
  [Request] POST http://localhost/joomla-cms4/api/index.php/v1/content/categories {"title":"A test category","parent_id":2,"params":{"workflow_id":"inherit"}}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/categories
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:39 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:39 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["385"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/content/categories"},"data":{"type":"categories","id":"11","attributes":{"parent_id":2,"level":2,"lft":2,"rgt":3,"alias":"a-test-category","id":11,"extension":"com_content","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I grab data from response by json path "$.data.id"
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send get "/content/categories/11"
  [Request] GET http://localhost/joomla-cms4/api/index.php/v1/content/categories/11
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/categories/11
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:39 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:39 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["389"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] {"links":{"self":"http://localhost/joomla-cms4/api/index.php/v1/content/categories/11"},"data":{"type":"categories","id":"11","attributes":{"parent_id":2,"level":2,"lft":2,"rgt":3,"alias":"a-test-category","id":11,"extension":"com_content","title":"A test category","note":"","published":0,"checked_out":null,"checked_out_time":null,"access":1,"created_user_id":3,"language":""}}}
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Content-Type","application/json"
 I have http header "Accept","application/vnd.api+json"
 I send patch "/content/categories/11",{"title":"Another Title","params":{"w...}
  [Request] PATCH http://localhost/joomla-cms4/api/index.php/v1/content/categories/11 {"title":"Another Title","params":{"workflow_id":"inherit"},"published":-2}
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/categories/11
  [Response] 200
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:39 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:39 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Length":["2"],"Content-Type":["application/vnd.api+json; charset=utf-8"]}
  [Response] []
 I see response code is 200
 I am bearer authenticated "c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2Mx..."
 I have http header "Accept","application/vnd.api+json"
 I send delete "/content/categories/11"
  [Request] DELETE http://localhost/joomla-cms4/api/index.php/v1/content/categories/11 []
  [Request Headers] {"Authorization":"Bearer c2hhMjU2OjM6ZTJmMjJlYTNlNTU0NmM1MDJhYTIzYzMwN2MxYzAwZTQ5NzJhMWRmOTUyNjY5MTk2YjE5ODJmZWMwZTcxNzgwMQ==","Content-Type":"application/json","Accept":"application/vnd.api+json"}
  [Page] http://localhost/joomla-cms4/api/index.php/v1/content/categories/11
  [Response] 204
  [Request Cookies] []
  [Response Headers] {"Date":["Tue, 01 Sep 2020 09:51:39 GMT"],"Server":["Apache/2.4.29 (Ubuntu)"],"x-frame-options":["SAMEORIGIN"],"referrer-policy":["strict-origin-when-cross-origin"],"cross-origin-opener-policy":["same-origin"],"X-Powered-By":["JoomlaAPI/1.0"],"Expires":["Wed, 17 Aug 2005 00:00:00 GMT"],"Last-Modified":["Tue, 01 Sep 2020 09:51:40 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Content-Type":["text/html"]}
  [Response] 
 I see response code is 204
 PASSED 

--------------------------------------------------------------------------------


Time: 8.63 seconds, Memory: 14.00 MB

OK (9 tests, 27 assertions)
  [Db] Disconnected from default

Command 'q' not found, but can be installed with:

sudo snap install q                       # version 1.6.3-1, or
sudo apt  install python-q-text-as-data 
sudo apt  install python3-q-text-as-data

See 'snap info q' for additional versions.


avatar astridx astridx - test_item - 1 Sep 2020 - Tested successfully
avatar astridx
astridx - comment - 1 Sep 2020

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.

avatar alikon alikon - change - 1 Sep 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 1 Sep 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26722.

avatar zero-24 zero-24 - change - 1 Sep 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-09-01 11:17:08
Closed_By zero-24
Labels Added: ?
Removed: ?
avatar zero-24 zero-24 - close - 1 Sep 2020
avatar zero-24 zero-24 - merge - 1 Sep 2020
avatar zero-24
zero-24 - comment - 1 Sep 2020

Thanks merged.

Add a Comment

Login with GitHub to post a comment