Repository navigation
Expand file tree
/
Copy pathphpunit.pgsql.xml
More file actions
81 lines (78 loc) · 4.41 KB
/
Copy pathphpunit.pgsql.xml
File metadata and controls
81 lines (78 loc) · 4.41 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Runs the suite against the PostgreSQL 18 service in compose.test.yml, which the
default sqlite config never exercises.
docker compose -f compose.test.yml up -d pgsql
bin/test-db.sh pgsql
Use the script rather than `pest -c` directly. It creates the scratch
database `phpvms_suite` for the run and drops it afterwards. Do not aim this
at the `testing` database compose.test.yml ships: a local .env may point the
development app at that same name on the same container, and the suite runs
RefreshDatabase, which would drop the schema out from under a running app.
Worth doing before shipping anything schema-shaped. sqlite silently accepts
things a real server rejects: it does not enforce TRUNCATE against a
foreign-key-referenced table, and it has no collation or jsonb behaviour to
disagree with. Credentials match compose.test.yml.
-->
<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>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
<!-- The Arch suite is disabled: six tests that cost ~3s alone but add
~1750s when they run in a process that has already loaded the rest
of the suite, because every `toBeUsed`/`toOnlyBeUsedIn` walks every
class the process can see. Run it on its own when you want it:
`vendor/bin/pest` with the entry restored. -->
<testsuite name="Components">
<directory suffix=".test.php">resources/views</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
</include>
</source>
<php>
<server name="APP_ENV" value="testing" force="true"/>
<env name="APP_ENV" value="testing" force="true"/>
<env name="APP_MAINTENANCE_DRIVER" value="file" force="true"/>
<env name="BCRYPT_ROUNDS" value="4" force="true"/>
<env name="BROADCAST_CONNECTION" value="null" force="true"/>
<env name="CACHE_STORE" value="array" force="true"/>
<!-- A cached bootstrap/cache/config.php (written by `artisan optimize`,
which the updater runs) is loaded verbatim at boot and BYPASSES all
of the env forcing below, pointing the whole suite at the real
dev database. Pin the cache lookup to a path that never exists so
tests always resolve config from files + these env values. -->
<server name="APP_CONFIG_CACHE" value="cache/config-phpunit-never-cached.php" force="true"/>
<env name="APP_CONFIG_CACHE" value="cache/config-phpunit-never-cached.php" force="true"/>
<server name="APP_ROUTES_CACHE" value="cache/routes-phpunit-never-cached.php" force="true"/>
<env name="APP_ROUTES_CACHE" value="cache/routes-phpunit-never-cached.php" force="true"/>
<!-- Both blocks are required. Laravel resolves env() through a repository
that reads $_SERVER before $_ENV, and the CLI SAPI copies exported
shell variables into $_SERVER, so an exported DB_CONNECTION silently
redirects the whole suite at a real database. <env force> alone does
not stop it; the <server> entries do. Same reason APP_ENV above is
declared twice. -->
<server name="DB_CONNECTION" value="pgsql" force="true"/>
<server name="DB_DATABASE" value="phpvms_suite" force="true"/>
<server name="DB_URL" value="postgres://phpvms:password@127.0.0.1:15432/phpvms_suite" force="true"/>
<env name="DB_CONNECTION" value="pgsql" force="true"/>
<env name="DB_DATABASE" value="phpvms_suite" force="true"/>
<env name="DB_URL" value="postgres://phpvms:password@127.0.0.1:15432/phpvms_suite" force="true"/>
<env name="MAIL_MAILER" value="array" force="true"/>
<env name="QUEUE_CONNECTION" value="sync" force="true"/>
<env name="SESSION_DRIVER" value="array" force="true"/>
<env name="PULSE_ENABLED" value="false" force="true"/>
<env name="TELESCOPE_ENABLED" value="false" force="true"/>
<env name="NIGHTWATCH_ENABLED" value="false" force="true"/>
</php>
</phpunit>