Skip to content

Commit 4d88fdc

Browse files
authored
Merge pull request #2577 from MGatner/tests-refactor
Refactor Tests
2 parents cc2823c + d40f105 commit 4d88fdc

File tree

200 files changed

+2026
-754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+2026
-754
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,5 @@ nb-configuration.xml
123123
.vscode/
124124

125125
/results/
126-
/phpunit*.xml
126+
/phpunit*.xml
127+
/.phpunit.*.cache

admin/framework/phpunit.xml.dist

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,60 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="tests/_support/_bootstrap.php"
3-
backupGlobals="false"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
stopOnError="false"
9-
stopOnFailure="false"
10-
stopOnIncomplete="false"
11-
stopOnSkipped="false">
12-
<testsuites>
13-
<testsuite name="app">
14-
<directory>./tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
18-
<php>
19-
<env name="app.baseURL" value="http://example.com"/>
20-
</php>
2+
<phpunit bootstrap="system/Test/bootstrap.php"
3+
backupGlobals="false"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
stopOnError="false"
9+
stopOnFailure="false"
10+
stopOnIncomplete="false"
11+
stopOnSkipped="false">
12+
<testsuites>
13+
<testsuite name="app">
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
2117

18+
<filter>
19+
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
20+
<directory suffix=".php">./app</directory>
21+
<exclude>
22+
<directory suffix=".php">./app/Views</directory>
23+
<file>./app/Config/Routes.php</file>
24+
</exclude>
25+
</whitelist>
26+
</filter>
27+
28+
<logging>
29+
<log type="coverage-html" target="build/logs/html"/>
30+
<log type="coverage-clover" target="build/logs/clover.xml"/>
31+
<log type="coverage-php" target="build/logs/coverage.serialized"/>
32+
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
33+
<log type="testdox-html" target="build/logs/testdox.html"/>
34+
<log type="testdox-text" target="build/logs/testdox.txt"/>
35+
<log type="junit" target="build/logs/logfile.xml"/>
36+
</logging>
37+
38+
<php>
39+
<server name="app.baseURL" value="http://example.com"/>
40+
41+
<!-- Directory containing phpunit.xml -->
42+
<const name="HOMEPATH" value="./"/>
43+
44+
<!-- Directory containing the Paths config file -->
45+
<const name="CONFIGPATH" value="./app/Config/"/>
46+
47+
<!-- Directory containing the front controller (index.php) -->
48+
<const name="PUBLICPATH" value="./public/"/>
49+
50+
<!-- Database configuration -->
51+
<!-- <env name="database.tests.hostname" value="localhost"/> -->
52+
<!-- <env name="database.tests.database" value="tests"/> -->
53+
<!-- <env name="database.tests.username" value="tests_user"/> -->
54+
<!-- <env name="database.tests.password" value=""/> -->
55+
<!-- <env name="database.tests.DBDriver" value="MySQLi"/> -->
56+
<!-- <env name="database.tests.DBPrefix" value="tests_"/> -->
57+
<env name="database.tests.database" value=":memory:"/>
58+
<env name="database.tests.DBDriver" value="SQLite3"/>
59+
</php>
2260
</phpunit>

admin/module/.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#-------------------------
2+
# Operating Specific Junk Files
3+
#-------------------------
4+
5+
# OS X
6+
.DS_Store
7+
.AppleDouble
8+
.LSOverride
9+
10+
# OS X Thumbnails
11+
._*
12+
13+
# Windows image file caches
14+
Thumbs.db
15+
ehthumbs.db
16+
Desktop.ini
17+
18+
# Recycle Bin used on file shares
19+
$RECYCLE.BIN/
20+
21+
# Windows Installer files
22+
*.cab
23+
*.msi
24+
*.msm
25+
*.msp
26+
27+
# Windows shortcuts
28+
*.lnk
29+
30+
# Linux
31+
*~
32+
33+
# KDE directory preferences
34+
.directory
35+
36+
# Linux trash folder which might appear on any partition or disk
37+
.Trash-*
38+
39+
#-------------------------
40+
# Environment Files
41+
#-------------------------
42+
# These should never be under version control,
43+
# as it poses a security risk.
44+
.env
45+
.vagrant
46+
Vagrantfile
47+
48+
#-------------------------
49+
# Temporary Files
50+
#-------------------------
51+
writable/cache/*
52+
!writable/cache/index.html
53+
54+
writable/logs/*
55+
!writable/logs/index.html
56+
57+
writable/session/*
58+
!writable/session/index.html
59+
60+
writable/uploads/*
61+
!writable/uploads/index.html
62+
63+
writable/debugbar/*
64+
65+
php_errors.log
66+
67+
#-------------------------
68+
# User Guide Temp Files
69+
#-------------------------
70+
user_guide_src/build/*
71+
user_guide_src/cilexer/build/*
72+
user_guide_src/cilexer/dist/*
73+
user_guide_src/cilexer/pycilexer.egg-info/*
74+
75+
#-------------------------
76+
# Test Files
77+
#-------------------------
78+
tests/coverage*
79+
80+
# Don't save phpunit under version control.
81+
phpunit
82+
83+
#-------------------------
84+
# Composer
85+
#-------------------------
86+
vendor/
87+
composer.lock
88+
89+
#-------------------------
90+
# IDE / Development Files
91+
#-------------------------
92+
93+
# Modules Testing
94+
_modules/*
95+
96+
# phpenv local config
97+
.php-version
98+
99+
# Jetbrains editors (PHPStorm, etc)
100+
.idea/
101+
*.iml
102+
103+
# Netbeans
104+
nbproject/
105+
build/
106+
nbbuild/
107+
dist/
108+
nbdist/
109+
nbactions.xml
110+
nb-configuration.xml
111+
.nb-gradle/
112+
113+
# Sublime Text
114+
*.tmlanguage.cache
115+
*.tmPreferences.cache
116+
*.stTheme.cache
117+
*.sublime-workspace
118+
*.sublime-project
119+
.phpintel
120+
/api/
121+
122+
# Visual Studio Code
123+
.vscode/
124+
125+
/results/
126+
/phpunit*.xml
127+
/.phpunit.*.cache

admin/module/composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "mydomain/mymodule",
3+
"description": "CodeIgniter4 starter module",
4+
"homepage": "https://codeigniter.com",
5+
"license": "MIT",
6+
"minimum-stability": "dev",
7+
"repositories": [
8+
{
9+
"type": "vcs",
10+
"url": "https://github.com/codeigniter4/codeigniter4"
11+
}
12+
],
13+
"require": {
14+
"php": ">=7.2"
15+
},
16+
"require-dev": {
17+
"mikey179/vfsstream": "1.6.*",
18+
"phpunit/phpunit": "8.5.*",
19+
"codeigniter4/codeigniter4": "dev-develop"
20+
},
21+
"autoload-dev": {
22+
"psr-4": {
23+
"Tests\\Support\\": "tests/_support"
24+
}
25+
},
26+
"scripts": {
27+
"test": "phpunit",
28+
"post-update-cmd": [
29+
"@composer dump-autoload"
30+
]
31+
},
32+
"support": {
33+
"forum": "http://forum.codeigniter.com/",
34+
"source": "https://github.com/codeigniter4/CodeIgniter4",
35+
"slack": "https://codeigniterchat.slack.com"
36+
}
37+
}

admin/module/phpunit.xml.dist

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
3+
backupGlobals="false"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
stopOnError="false"
9+
stopOnFailure="false"
10+
stopOnIncomplete="false"
11+
stopOnSkipped="false">
12+
<testsuites>
13+
<testsuite name="app">
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<filter>
19+
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
20+
<directory suffix=".php">./src</directory>
21+
<exclude>
22+
<directory suffix=".php">./src/Views</directory>
23+
<file>./src/Config/Routes.php</file>
24+
</exclude>
25+
</whitelist>
26+
</filter>
27+
28+
<logging>
29+
<log type="coverage-html" target="build/logs/html"/>
30+
<log type="coverage-clover" target="build/logs/clover.xml"/>
31+
<log type="coverage-php" target="build/logs/coverage.serialized"/>
32+
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
33+
<log type="testdox-html" target="build/logs/testdox.html"/>
34+
<log type="testdox-text" target="build/logs/testdox.txt"/>
35+
<log type="junit" target="build/logs/logfile.xml"/>
36+
</logging>
37+
38+
<php>
39+
<server name="app.baseURL" value="http://example.com"/>
40+
41+
<!-- Directory containing phpunit.xml -->
42+
<const name="HOMEPATH" value="./"/>
43+
44+
<!-- Directory containing the Paths config file -->
45+
<const name="CONFIGPATH" value="./vendor/codeigniter4/framework/app/Config/"/>
46+
47+
<!-- Directory containing the front controller (index.php) -->
48+
<const name="PUBLICPATH" value="./vendor/codeigniter4/framework/public/"/>
49+
50+
<!-- Database configuration -->
51+
<!-- <env name="database.tests.hostname" value="localhost"/> -->
52+
<!-- <env name="database.tests.database" value="tests"/> -->
53+
<!-- <env name="database.tests.username" value="tests_user"/> -->
54+
<!-- <env name="database.tests.password" value=""/> -->
55+
<!-- <env name="database.tests.DBDriver" value="MySQLi"/> -->
56+
<!-- <env name="database.tests.DBPrefix" value="tests_"/> -->
57+
<env name="database.tests.database" value=":memory:"/>
58+
<env name="database.tests.DBDriver" value="SQLite3"/>
59+
</php>
60+
</phpunit>

0 commit comments

Comments
 (0)