Repository navigation
Expand file tree
/
Copy pathphpunit.xml
More file actions
132 lines (131 loc) · 8.18 KB
/
Copy pathphpunit.xml
File metadata and controls
132 lines (131 loc) · 8.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./app</directory>
</include>
<exclude>
<!-- Large machine-generated reference-data enums (kept in sync with the
excludePaths list in phpstan.neon.dist, for the same reason). Each case
carries a big constant data attribute; ZipCode.php alone is ~6 MB / ~40k
cases. php-code-coverage's static analyser exhausts memory parsing files
this size, and the generated case lists have no hand-written control flow
worth covering or mutating — so coverage/mutation buys no value here. -->
<file>app/Enums/CanadianProvince.php</file>
<file>app/Enums/Country.php</file>
<file>app/Enums/County.php</file>
<file>app/Enums/CredentialRegistry.php</file>
<file>app/Enums/Currency.php</file>
<file>app/Enums/InternationalCodeDesignator.php</file>
<file>app/Enums/IscedA2011.php</file>
<file>app/Enums/IscedF2013.php</file>
<file>app/Enums/IscedP2011.php</file>
<file>app/Enums/Isco08.php</file>
<file>app/Enums/Language.php</file>
<file>app/Enums/LanguageBCP47.php</file>
<file>app/Enums/MimeType.php</file>
<file>app/Enums/SchemaDataType.php</file>
<file>app/Enums/SchemaEnumerationMember.php</file>
<file>app/Enums/SchemaProperty.php</file>
<file>app/Enums/SchemaType.php</file>
<file>app/Enums/State.php</file>
<file>app/Enums/ZipCode.php</file>
</exclude>
</source>
<php>
<!-- Every pin below is bound twice, so a variable the shell already
exports cannot override it (UAMS-Web/uams-statamic-archive#2981, UAMS-Web/uams-statamic-archive#3031). The server entry is
what binds: Laravel's env() reads $_SERVER first, and PHPUnit
always writes server entries. The env entry needs force="true"
to replace an exported value, and it is what a spawned child
process inherits. A new pin needs both entries;
tests/Feature/Config/PhpunitEnvironmentPinsTest.php fails on a
pin that has only one. -->
<env name="APP_ENV" value="testing" force="true"/>
<server name="APP_ENV" value="testing"/>
<env name="APP_TIMEZONE" value="UTC" force="true"/>
<server name="APP_TIMEZONE" value="UTC"/>
<env name="STATAMIC_DISPLAY_TIMEZONE" value="America/Chicago" force="true"/>
<server name="STATAMIC_DISPLAY_TIMEZONE" value="America/Chicago"/>
<env name="BCRYPT_ROUNDS" value="4" force="true"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<!-- Pin the test cache store under the name config/cache.php reads
(UAMS-Web/uams-statamic-archive#2981); the suite relies on a file-backed cache shared between
processes. -->
<env name="CACHE_STORE" value="file" force="true"/>
<server name="CACHE_STORE" value="file"/>
<!-- Force the NullCacher in tests. The static-cache middleware
(Statamic\StaticCaching\Middleware\Cache) acquires a per-URL lock on
every front-end request and returns 503 on a LockTimeoutException; a
real cacher contends across paratest workers and flakes the parallel
suite, while the NullCacher's lock is a no-op. The Cacher is a boot-time
singleton, so this must be set before the app boots (a per-test rebind
is too late) — hence here rather than in TestCase::setUp. -->
<env name="STATAMIC_STATIC_CACHING_STRATEGY" value="null" force="true"/>
<server name="STATAMIC_STATIC_CACHING_STRATEGY" value="null"/>
<!-- Disable the Stache warming lock in tests — the sibling of the line
above, and the other half of the same 503. Statamic's Stache lock is a
FlockStore over the single, NON-tokenized `storage/statamic/stache-locks`
directory, so it is shared by every paratest worker. `Stache::warm()`
holds it for the whole warm while `Statamic\Http\Middleware\StacheLock`
makes every other worker's front-end request wait 30s for it and then
return 503 — the UAMS-Web/uams-statamic-archive#1689 `Error404PageTest` flake, and the `GET /` 503
that put `ExampleTest` in the serial tail. Each worker has its own
cache store and warms independently, so the lock deduplicates nothing
here. Read at boot by config/statamic/stache.php.
This pin and the two other switches below are written as 0, never
false (UAMS-Web/uams-statamic-archive#3303). PHPUnit writes `false` to the environment as an empty value, and on
Windows that removes a variable the shell exported instead of
emptying it, so a child process the suite spawns reads it as unset
and gets the production default `true`. Every reader casts with
`(bool) env(...)`, so 0 reads as false. -->
<env name="STATAMIC_STACHE_LOCK_ENABLED" value="0" force="true"/>
<server name="STATAMIC_STACHE_LOCK_ENABLED" value="0"/>
<env name="DB_CONNECTION" value="sqlite" force="true"/>
<server name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:" force="true"/>
<server name="DB_DATABASE" value=":memory:"/>
<env name="ASSET_METADATA_DATABASE" value=":memory:" force="true"/>
<server name="ASSET_METADATA_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array" force="true"/>
<server name="MAIL_MAILER" value="array"/>
<!-- Disable the on-publish link scan (UAMS-Web/uams-statamic-archive#1772) by default in tests. The
listener is registered for every EntrySaved and the queue here is
`sync`, so with it on, every test that saves a published entry runs
link-health:scan inline and issues real outbound requests to every
host that entry links to. Its own suite re-enables it (config())
alongside Queue::fake. The recurring scan is left on: it only
registers a schedule entry, which nothing in a test executes.
Written as 0, not false: see the Stache lock pin above (UAMS-Web/uams-statamic-archive#3303). -->
<env name="LINK_HEALTH_SCAN_ON_PUBLISH" value="0" force="true"/>
<server name="LINK_HEALTH_SCAN_ON_PUBLISH" value="0"/>
<!-- Disable coordinate-derived location regions (UAMS-Web/uams-statamic-archive#962) by default in
tests so saving a clinical_locations entry never makes a real Census
reverse-geocode HTTP call. The geocoder's own test re-enables it
(config()->set) alongside Http::fake. Written as 0, not false: see
the Stache lock pin above (UAMS-Web/uams-statamic-archive#3303). -->
<env name="MAP_CENSUS_GEOCODER_ENABLED" value="0" force="true"/>
<server name="MAP_CENSUS_GEOCODER_ENABLED" value="0"/>
<!-- PubMed lookups refuse without a contact email (UAMS-Web/uams-statamic-archive#2409). The suite runs
as a configured client would; the refusal itself is asserted by a test
that clears this value explicitly. -->
<env name="PUBMED_CONTACT_EMAIL" value="testing@example.com" force="true"/>
<server name="PUBMED_CONTACT_EMAIL" value="testing@example.com"/>
<env name="QUEUE_CONNECTION" value="sync" force="true"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array" force="true"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>