You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/subsystems/external/testing.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,18 @@ Writing unit tests for an external service function is no different to writing u
20
20
21
21
## How to write an external function PHPUnit test
22
22
23
-
You should create one unit test testcase for each external service file, and it should be named after the file that it tests.
23
+
You should create one unit test testcase for each external service class, and it should be named after the class that it tests.
24
24
25
25
For example, if you have written a service function in `[componentfolder]/classes/external/get_fruit.php`, you should write a unit test in `[componentfolder]/tests/external/get_fruit_test.php`.
26
26
27
+
:::note External Services Testcase
28
+
29
+
An external testcase has been created to make testing external services easier.
30
+
31
+
When creating your tests, you can extend the `\core_external\tests\externallib_testcase` class instead of `\advanced_testcase`.
0 commit comments