Commit graph

148 commits

Author SHA1 Message Date
eldadfux
4bf3c72196 fix: allow users to update phone number to empty without causing duplicate errors 2026-03-11 06:25:08 +01:00
Jake Barnby
bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
Jake Barnby
64a368ba3d Merge remote-tracking branch 'origin/feat-db-tests' into feat-mongodb
# Conflicts:
#	.github/workflows/tests.yml
#	src/Appwrite/Utopia/Response.php
#	src/Appwrite/Utopia/Response/Model/AttributeList.php
#	tests/e2e/Client.php
#	tests/e2e/Scopes/ProjectCustom.php
#	tests/e2e/Services/Databases/DatabasesBase.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/Transactions/TransactionsBase.php
#	tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php
#	tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php
#	tests/e2e/Services/Messaging/MessagingBase.php
#	tests/e2e/Services/Sites/SitesBase.php
#	tests/e2e/Services/Sites/SitesCustomServerTest.php
2026-02-18 03:27:23 +13:00
Jake Barnby
9b2dd958b5 fix: Use correct capability check for partial fulltext search in Users test
PostgreSQL's ts_vector/ts_query doesn't support partial word matching
(searching "man" won't find "manchester"), unlike MariaDB's LIKE-based
search. The test used getSupportForRelationships() as a proxy for this
capability, which was wrong for PostgreSQL (supports relationships but
not partial fulltext search).

Add supportForFulltextWildcard to console variables endpoint and use
it in the Users test instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:56:39 +13:00
Jake Barnby
a4cca146d3 fix: Remove undefined $totalUsers and use parallel-safe assertions
The testListUsers function was using $totalUsers which was removed when
the test was refactored for parallel execution. Now uses $minUsers and
flexible assertions instead of position-based assertions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:22:14 +13:00
Jake Barnby
a79f33a3a1 fix: Remove incorrect json_decode in setupUser
The client body is already decoded as array, not JSON string.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:13:23 +13:00
Jake Barnby
d4020686f2 fix: Make testListUsers parallel-safe
- Use assertGreaterThanOrEqual instead of exact count
- Find users by ID instead of assuming position
- Document expected minimum user count for isolated execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:53:42 +13:00
Jake Barnby
f624646480 perf: Remove @depends from Account, Functions, Storage, Users, VCS, Messaging tests
Added helper methods with static caching to enable parallel test execution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 11:54:14 +13:00
Jake Barnby
714b8d7ea6 Migrate to PHPUnit 11 2026-01-15 16:14:53 +13:00
Jake Barnby
2776925540 Tests via console features 2025-11-25 21:11:01 +13:00
Jake Barnby
d8d970e03e Merge remote-tracking branch 'origin/1.8.x' into feat-mongodb
# Conflicts:
#	app/controllers/api/account.php
#	app/controllers/api/messaging.php
#	app/controllers/api/projects.php
#	app/controllers/api/storage.php
#	app/controllers/api/teams.php
#	app/controllers/api/users.php
#	composer.lock
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php
#	src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php
#	src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php
#	src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php
#	src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php
2025-11-20 17:46:19 +13:00
shimon
a7dbb3daea Refactor API parameters to replace 'includeTotal' with 'total' across multiple endpoints for consistency in response handling. 2025-10-29 11:08:08 +02:00
shimon
5f3316ff18 fix assertion order 2025-10-20 18:38:14 +03:00
shimon
fb4e3e1b9d Implement 'includeTotal' parameter across multiple API endpoints to control total count in responses, ensuring consistent behavior in session, log, and membership retrievals. 2025-10-20 18:18:17 +03:00
Jake Barnby
36782650c6
Revert "Add CI debug"
This reverts commit 2d3dea84e3.
2025-10-01 21:36:03 +13:00
Jake Barnby
2d3dea84e3
Add CI debug 2025-10-01 21:10:26 +13:00
Jake Barnby
daeb721995
Fix tests 2025-09-30 23:44:26 +13:00
shimon
f16eba2f9f Update PHPUnit configuration to stop on failure set to false, and clean up whitespace in multiple files for consistency. Adjust comments and ensure proper formatting in test cases and API handling. 2025-09-16 19:13:38 +03:00
shimon
89d06d00c0 Merge branch '1.8.x' of github.com:appwrite/appwrite into feat-mongodb-pulls
# Conflicts:
#	.github/workflows/tests.yml
#	composer.lock
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
2025-09-11 16:54:49 +03:00
Matej Bačo
2ce0f370dc PR review changes 2025-08-26 15:44:15 +02:00
shimon
b98be4756c Update composer.json and composer.lock to reflect changes in utopia-php/database versioning and dependencies. Adjusted MongoDB-related test conditions for improved compatibility and clarity. Removed unnecessary var_dump statements in account.php and enhanced logging in various test files for better debugging. 2025-08-26 13:48:01 +03:00
shimon
c4fb7ecbc1 Refactor and clean up debugging output across multiple files, including mock.php, account.php, and OAuth2 classes. Removed unnecessary var_dump statements for improved code clarity and consistency. Updated MongoDB condition checks in test cases to ensure case-insensitive comparisons. 2025-08-12 15:20:30 +03:00
shimon
870125ed84 Refactor MongoDB condition checks in DatabasesCustomClientTest and UsersBase. Improved formatting for consistency and clarity in test assertions, particularly for MongoDB-related tests. 2025-08-11 22:07:05 +03:00
shimon
e1475619ba Refactor debugging output across various files, including http.php, mock.php, and OAuth2 classes. Adjusted var_dump statements for improved traceability and consistency. Updated test assertions in ProjectsConsoleClientTest and UsersBase to enhance clarity and functionality. 2025-08-11 22:05:18 +03:00
shimon
da706378ea Enhance debugging output in OAuth2 mock endpoints and update MongoDB version in tests. Added var_dump statements for better traceability during OAuth2 flows and adjusted test assertions for user search functionality. 2025-08-11 11:27:45 +03:00
ArnabChatterjee20k
7a0ba95231 updated onPasswordChange to invalidate session 2025-06-16 23:05:52 +05:30
ArnabChatterjee20k
fde2f278e8 added invalidating sessions for the project users 2025-06-14 18:07:42 +05:30
Chirag Aggarwal
85edfc6af8 chore: added test for users.listmemberships 2025-03-28 05:47:18 +00:00
Steven Nguyen
f48c843bea
fix(users): ensure user can delete session
The session document created by users.createSession() was missing
delete permissions for the user so when the user tried to delete it,
they got a 401 error.

This PR ensure the permissions are added just like if the document was
created from the Account API so that the user has access to delete the
document.
2025-01-11 17:56:36 +00:00
Steven Nguyen
014c613c93
fix: update secret returned from users.createSession()
1. Include at least 1 factor because the minumum number of factors
   required when mfa is disabled is 1.
2. Purge the cached user document to ensure the new session is included
   in subsequent requests for the user.
3. Fix the encoding of the secret to match other parts of the codebase.
2024-11-22 21:52:27 +00:00
Jake Barnby
1ed3dee135
Fix tests 2024-10-22 14:54:34 +13:00
Jake Barnby
0a22292d1b
Update tests 2024-10-22 14:35:11 +13:00
Christy Jacob
bfa253297b Merge branch 'main' of https://github.com/appwrite/appwrite into sync-1.6-main 2024-08-13 15:36:13 +00:00
Matej Bačo
d4a5891c0d Fix user JWTs without sessionID 2024-07-21 13:28:23 +00:00
Jake Barnby
b343158d19
Merge remote-tracking branch 'origin/main' into 1.6.x
# Conflicts:
#	.gitmodules
#	app/console
#	composer.lock
#	tests/e2e/Services/Health/HealthCustomServerTest.php
2024-07-10 19:11:04 +12:00
Christy Jacob
8dbf887ab1
Merge pull request #8324 from appwrite/refactor-usage-sn
Sync refactor-usage-sn into 1.5.x
2024-06-25 22:50:42 +04:00
Steven Nguyen
34b2e15243
fix(users): fix expire error when creating user session
Before this, the Create session API call would throw:

> Invalid document structure: Missing required attribute "expire"

This is because the `expire` attribute is required, but it was omitted
from the document. This PR ensures the `expire` attribute is set when
creating the session document.
2024-06-24 23:21:44 +00:00
Damodar Lohani
d19141fc6a sleep after password change 2024-06-24 07:49:18 +00:00
Christy Jacob
a2f27ec15f Merge branch '1.5.x' of https://github.com/appwrite/appwrite into sync-with-main 2024-06-21 13:11:35 +00:00
Damodar Lohani
349b78d5e5 fix assertion 2024-06-17 04:55:06 +00:00
Matej Bačo
11827216ff
Update tests/e2e/Services/Users/UsersBase.php
Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com>
2024-05-29 09:32:58 +02:00
Matej Bačo
b1ff989c3f Implement tests, fix JWT maxAge 2024-05-28 09:25:54 +00:00
Torsten Dittmann
0a1d572c72 chore: run formatter 2024-03-06 18:34:21 +01:00
Matej Bačo
7beb9080fa Merge remote-tracking branch 'origin/1.5.x' into fix-empty-user-updates 2024-02-05 10:38:48 +00:00
fogelito
a782e20315 Merge branch '1.5.x' of github.com:appwrite/appwrite into json-parsing
 Conflicts:
	app/controllers/api/account.php
	composer.json
	composer.lock
	src/Appwrite/Platform/Tasks/CalcTierStats.php
	tests/e2e/Services/Account/AccountBase.php
2024-01-25 17:44:05 +02:00
Jake Barnby
8cfd194cc0
Fix user tests 2024-01-22 23:29:41 +13:00
Matej Bačo
311e9a75dd Allow empty values in PATH user service 2024-01-20 09:43:31 +00:00
loks0n
bc1858c516 chore: do not auto create accounts in users endpoints 2024-01-17 11:03:04 +00:00
loks0n
6bf82c3dc5 test: fix user token test 2024-01-15 11:30:54 +00:00
Jake Barnby
5044c0cafa
Fix users tests 2024-01-09 16:43:39 +13:00