Skip to content

Commit f561b3a

Browse files
committed
documentation
Signed-off-by: Piotr PG Gajek <[email protected]>
1 parent 948a968 commit f561b3a

File tree

2 files changed

+12
-2
lines changed
  • force-app/main/default/classes/main/standard-soql
  • website/docs/advanced-usage

2 files changed

+12
-2
lines changed

force-app/main/default/classes/main/standard-soql/SOQL.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ public virtual inherited sharing class SOQL implements Queryable {
23012301
return this.sharingExecutor.toSObjects(this.builder.toString(), binder.getBindingMap(), this.accessMode);
23022302
}
23032303

2304-
return Security.stripInaccessible(
2304+
return System.Security.stripInaccessible(
23052305
this.accessType,
23062306
this.sharingExecutor.toSObjects(this.builder.toString(), binder.getBindingMap(), this.accessMode)
23072307
).getRecords();
@@ -2324,7 +2324,7 @@ public virtual inherited sharing class SOQL implements Queryable {
23242324

23252325
private void incrementQueryIssued() {
23262326
// This counter is used only in unit tests to also track mocked queries.
2327-
if (!Test.isRunningTest() || System.isBatch() || System.isFuture() || System.isQueueable() || System.isScheduled()) {
2327+
if (!System.Test.isRunningTest() || System.isBatch() || System.isFuture() || System.isQueueable() || System.isScheduled()) {
23282328
return;
23292329
}
23302330

website/docs/advanced-usage/mocking.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ Account `Description` and `Website` are null, even though they were specified. H
9999
**Note:**
100100
Currently, this field-stripping behavior applies only to simple fields (like `Name`, `Description`, etc.). Relationship fields and subqueries are not yet included in this logic — this may be addressed in future enhancements.
101101

102+
### Queried Issued Count
103+
104+
Mocked queries in SOQL Lib are counted towards the SOQL query limit, just like real queries. If the number of issued queries exceeds the limit, SOQL Lib will throw:
105+
106+
```apex
107+
QueryException: Too many SOQL queries.
108+
```
109+
110+
This behavior is consistent with Salesforce’s native limits, ensuring that your unit tests accurately reflect potential production scenarios.
111+
102112
## List of records
103113

104114
```apex

0 commit comments

Comments
 (0)