33 lines
923 B
Plaintext
33 lines
923 B
Plaintext
``++SeeAllData=true++`` should not be used because it gives your tests access to all data in your organization. Activating this option makes your test dependent on existing data and more difficult to maintain. Tests should create their own data.
|
|
|
|
|
|
This rule raises an issue when it sees ``++@isTest(SeeAllData=true)++``.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
@isTest(SeeAllData=true) // Noncompliant
|
|
public class MyTestClass {
|
|
@isTest(SeeAllData=true) // Noncompliant
|
|
static void myTestMethod() {
|
|
// Can access all data in the organization.
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
== See
|
|
|
|
* https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_seealldata_using.htm[Salesforce documentation - Using the isTest(SeeAllData=True) Annotation]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|