Skip to content

Commit 894e0a6

Browse files
committed
WIP
1 parent 1b530cd commit 894e0a6

Some content is hidden

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

61 files changed

+629
-403
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@
111111
],
112112
"metrics": "utils/vendor/bin/phpmetrics --config=phpmetrics.json",
113113
"phpstan:baseline": "vendor/bin/phpstan analyse --ansi --generate-baseline=phpstan-baseline.php",
114-
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi",
114+
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi --memory-limit 2G",
115115
"sa": "@analyze",
116116
"style": "@cs-fix",
117-
"test": "phpunit"
117+
"test": "phpunit --no-coverage"
118118
},
119119
"scripts-descriptions": {
120120
"analyze": "Run static analysis",

errors.txt

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
15) CodeIgniter\Files\FileCollectionTest::testResolveDirectorySymlink
2+
ErrorException: symlink(): Permission denied
3+
4+
E:\www\CodeIgniterProjects\dev\tests\system\Files\FileCollectionTest.php:69
5+
6+
16) CodeIgniter\Files\FileCollectionTest::testResolveFileSymlink
7+
ErrorException: symlink(): Permission denied
8+
9+
E:\www\CodeIgniterProjects\dev\tests\system\Files\FileCollectionTest.php:89
10+
11+
17) CodeIgniter\HTTP\Files\FileMovingTest::testStore
12+
ErrorException: mkdir(): No such file or directory
13+
14+
E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:181
15+
E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:135
16+
E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:355
17+
E:\www\CodeIgniterProjects\dev\tests\system\HTTP\Files\FileMovingTest.php:213
18+
19+
18) CodeIgniter\Helpers\FilesystemHelperTest::testGetFilenamesWithSymlinks
20+
ErrorException: symlink(): Permission denied
21+
22+
E:\www\CodeIgniterProjects\dev\tests\system\Helpers\FilesystemHelperTest.php:408
23+
24+
19) CodeIgniter\Helpers\FilesystemHelperTest::testGetFileNotThereInfo
25+
TypeError: basename(): Argument #1 ($path) must be of type string, false given
26+
27+
E:\www\CodeIgniterProjects\dev\system\Helpers\filesystem_helper.php:322
28+
E:\www\CodeIgniterProjects\dev\tests\system\Helpers\FilesystemHelperTest.php:525
29+
30+
20) CodeIgniter\Publisher\PublisherInputTest::testAddUri
31+
CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate
32+
33+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:709
34+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:383
35+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:152
36+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:187
37+
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:331
38+
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherInputTest.php:140
39+
40+
21) CodeIgniter\Publisher\PublisherInputTest::testAddUris
41+
CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate
42+
43+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:709
44+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:383
45+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:152
46+
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:187
47+
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:331
48+
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:312
49+
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherInputTest.php:150
50+
51+
22) CodeIgniter\Publisher\PublisherSupportTest::testWipe
52+
CodeIgniter\Publisher\Exceptions\PublisherException: Destination is not on the allowed list of Publisher directories: "C:/Users/aleksandr/AppData/Local/Temp/2d8bc0469a5a/"
53+
54+
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:183
55+
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherSupportTest.php:166
56+
57+
--
58+
59+
There were 6 failures:
60+
61+
1) CodeIgniter\CodeIgniterTest::testRun404OverrideControllerReturnsResponse
62+
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
63+
<!DOCTYPE html>\n
64+
<html lang="en">\n
65+
<head>\n
66+
<meta charset="UTF-8">\n
67+
<title>Welcome to CodeIgniter 4!</title>\n
68+
<meta name="description" content="The small framework with powerful features">\n
69+
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
70+
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
71+
...
72+
</body>\n
73+
</html>\n
74+
\n
75+
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
76+
' [ASCII](length: 17399) contains "Oops" [ASCII](length: 4).
77+
78+
E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:164
79+
80+
2) CodeIgniter\CodeIgniterTest::testRun404OverrideReturnResponse
81+
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
82+
<!DOCTYPE html>\n
83+
<html lang="en">\n
84+
<head>\n
85+
<meta charset="UTF-8">\n
86+
<title>Welcome to CodeIgniter 4!</title>\n
87+
<meta name="description" content="The small framework with powerful features">\n
88+
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
89+
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
90+
...
91+
</body>\n
92+
</html>\n
93+
\n
94+
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
95+
' [ASCII](length: 17400) contains "Oops" [ASCII](length: 4).
96+
97+
E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:182
98+
99+
3) CodeIgniter\CodeIgniterTest::testRun404OverrideByClosure
100+
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
101+
<!DOCTYPE html>\n
102+
<html lang="en">\n
103+
<head>\n
104+
<meta charset="UTF-8">\n
105+
<title>Welcome to CodeIgniter 4!</title>\n
106+
<meta name="description" content="The small framework with powerful features">\n
107+
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
108+
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
109+
...
110+
</body>\n
111+
</html>\n
112+
\n
113+
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
114+
' [ASCII](length: 17365) contains "404 Override by Closure." [ASCII](length: 24).
115+
116+
E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:203
117+
118+
4) CodeIgniter\Commands\Database\ShowTableInfoMockIOTest::testDbTableWithInputs
119+
Failed asserting that '+-----------+----------+----------+----------+----------+------+\n
120+
| hostname | database | username | DBDriver | DBPrefix | port |\n
121+
+-----------+----------+----------+----------+----------+------+\n
122+
| 127.0.0.1 | :memory: | | SQLite3 | db_ | 3306 |\n
123+
+-----------+----------+----------+----------+----------+------+\n
124+
\n
125+
Here is the list of your database tables:\n
126+
[0] db_migrations\n
127+
[82] db_user\n
128+
[83] db_job\n
129+
[84] db_misc\n
130+
[85] db_type_test\n
131+
[86] db_empty\n
132+
[87] db_secondary\n
133+
[88] db_stringifypkey\n
134+
[89] db_without_auto_increment\n
135+
[90] db_ip_table\n
136+
[92] db_foo\n
137+
\n
138+
Which table do you want to see? [0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92]: a\n
139+
The "Which table do you want to see?" field must be one of: 0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92.\n
140+
\n
141+
Which table do you want to see? [0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92]: 0\n
142+
\n
143+
Data of Table "db_migrations":\n
144+
\n
145+
+----+----------------+--------------------+-------+---------------+------------+-------+\n
146+
| id | version | class | group | namespace | time | batch |\n
147+
+----+----------------+--------------------+-------+---------------+------------+-------+\n
148+
| 14 | 20160428212500 | Tests\Support\D... | tests | Tests\Support | 1733827161 | 1 |\n
149+
+----+----------------+--------------------+-------+---------------+------------+-------+\n
150+
\n
151+
' matches PCRE pattern "/Which table do you want to see\? \[0, 1, 2, 3, 4, 5, 6, 7, 8, 9.*?\]: a
152+
The "Which table do you want to see\?" field must be one of: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.*?./".
153+
154+
E:\www\CodeIgniterProjects\dev\tests\system\Commands\Database\ShowTableInfoMockIOTest.php:63
155+
156+
5) CodeIgniter\Commands\Database\ShowTableInfoTest::testDbTableShow
157+
Failed asserting that '+-----------+----------+----------+----------+----------+------+\n
158+
| hostname | database | username | DBDriver | DBPrefix | port |\n
159+
+-----------+----------+----------+----------+----------+------+\n
160+
| 127.0.0.1 | :memory: | | SQLite3 | db_ | 3306 |\n
161+
+-----------+----------+----------+----------+----------+------+\n
162+
\n
163+
The following is a list of the names of all database tables:\n
164+
\n
165+
+-----+---------------------------+-------------+---------------+\n
166+
| ID | Table Name | Num of Rows | Num of Fields |\n
167+
+-----+---------------------------+-------------+---------------+\n
168+
| 1 | db_migrations | 1 | 7 |\n
169+
| 93 | db_foo | 1 | 1 |\n
170+
| 94 | db_user | 0 | 7 |\n
171+
| 95 | db_job | 0 | 6 |\n
172+
| 96 | db_misc | 0 | 3 |\n
173+
| 97 | db_type_test | 0 | 21 |\n
174+
| 98 | db_empty | 0 | 4 |\n
175+
| 99 | db_secondary | 0 | 3 |\n
176+
| 100 | db_stringifypkey | 0 | 2 |\n
177+
| 101 | db_without_auto_increment | 0 | 2 |\n
178+
| 102 | db_ip_table | 0 | 2 |\n
179+
+-----+---------------------------+-------------+---------------+\n
180+
\n
181+
\n
182+
' [ASCII](length: 1380) contains "+----+---------------------------+-------------+---------------+
183+
| ID | Table Name | Num of Rows | Num of Fields |
184+
+----+---------------------------+-------------+---------------+" [ASCII](length: 194).
185+
186+
E:\www\CodeIgniterProjects\dev\tests\system\Commands\Database\ShowTableInfoTest.php:103
187+
188+
6) CodeIgniter\Security\CheckPhpIniTest::testCheckIni
189+
Failed asserting that two arrays are identical.
190+
--- Expected
191+
+++ Actual
192+
@@ @@
193+
Array &0 [
194+
- 'global' => '',
195+
+ 'global' => '1',
196+
'current' => '1',
197+
'recommended' => '0',
198+
'remark' => '',
199+
]
200+
201+
E:\www\CodeIgniterProjects\dev\tests\system\Security\CheckPhpIniTest.php:37
202+

phpunit.xml.dist

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,64 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
5-
bootstrap="system/Test/bootstrap.php"
6-
backupGlobals="false"
7-
beStrictAboutOutputDuringTests="true"
8-
colors="true"
9-
columns="max"
10-
failOnRisky="true"
11-
failOnWarning="true"
12-
cacheDirectory="build/.phpunit.cache">
13-
<coverage
14-
includeUncoveredFiles="true"
15-
pathCoverage="false"
16-
ignoreDeprecatedCodeUnits="true"
17-
disableCodeCoverageIgnore="true">
18-
<report>
19-
<clover outputFile="build/logs/clover.xml"/>
20-
<html outputDirectory="build/coverage/html" highLowerBound="80"/>
21-
<text outputFile="build/coverage/coverage.txt"/>
22-
</report>
23-
</coverage>
24-
<extensions>
25-
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
26-
<parameter name="time-limit" value="0.50" />
27-
<parameter name="report-count" value="30" />
28-
</bootstrap>
29-
</extensions>
30-
<testsuites>
31-
<testsuite name="System">
32-
<directory>tests/system</directory>
33-
</testsuite>
34-
</testsuites>
35-
<source>
36-
<include>
37-
<directory suffix=".php">system</directory>
38-
</include>
39-
<exclude>
40-
<directory>system/Commands/Generators/Views</directory>
41-
<directory>system/Debug/Toolbar/Views</directory>
42-
<directory>system/Pager/Views</directory>
43-
<directory>system/ThirdParty</directory>
44-
<directory>system/Validation/Views</directory>
45-
<file>system/bootstrap.php</file>
46-
<file>system/ComposerScripts.php</file>
47-
<file>system/Config/Routes.php</file>
48-
<file>system/Test/bootstrap.php</file>
49-
<file>system/Test/ControllerTester.php</file>
50-
<file>system/Test/FeatureTestCase.php</file>
51-
</exclude>
52-
</source>
53-
<php>
54-
<server name="app.baseURL" value="http://example.com/"/>
55-
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>
56-
<!-- Directory containing phpunit.xml -->
57-
<const name="HOMEPATH" value="./"/>
58-
<!-- Directory containing the Paths config file -->
59-
<const name="CONFIGPATH" value="./app/Config/"/>
60-
<!-- Directory containing the front controller (index.php) -->
61-
<const name="PUBLICPATH" value="./public/"/>
62-
</php>
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
5+
bootstrap="system/Test/bootstrap.php"
6+
backupGlobals="false"
7+
beStrictAboutOutputDuringTests="true"
8+
colors="true"
9+
columns="max"
10+
failOnRisky="true"
11+
failOnWarning="true"
12+
cacheDirectory="build/.phpunit.cache"
13+
>
14+
<coverage
15+
pathCoverage="false"
16+
ignoreDeprecatedCodeUnits="true"
17+
disableCodeCoverageIgnore="false"
18+
>
19+
<report>
20+
<clover outputFile="build/logs/clover.xml"/>
21+
<html outputDirectory="build/coverage/html" highLowerBound="80"/>
22+
<text outputFile="build/coverage/coverage.txt"/>
23+
</report>
24+
</coverage>
25+
<extensions>
26+
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
27+
<parameter name="time-limit" value="0.50"/>
28+
<parameter name="report-count" value="30"/>
29+
</bootstrap>
30+
</extensions>
31+
<testsuites>
32+
<testsuite name="System">
33+
<directory>tests/system</directory>
34+
</testsuite>
35+
</testsuites>
36+
<source>
37+
<include>
38+
<directory suffix=".php">system</directory>
39+
</include>
40+
<exclude>
41+
<directory>system/Commands/Generators/Views</directory>
42+
<directory>system/Debug/Toolbar/Views</directory>
43+
<directory>system/Pager/Views</directory>
44+
<directory>system/ThirdParty</directory>
45+
<directory>system/Validation/Views</directory>
46+
<file>system/bootstrap.php</file>
47+
<file>system/ComposerScripts.php</file>
48+
<file>system/Config/Routes.php</file>
49+
<file>system/Test/bootstrap.php</file>
50+
<file>system/Test/ControllerTester.php</file>
51+
<file>system/Test/FeatureTestCase.php</file>
52+
</exclude>
53+
</source>
54+
<php>
55+
<server name="app.baseURL" value="http://example.com/"/>
56+
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>
57+
<!-- Directory containing phpunit.xml -->
58+
<const name="HOMEPATH" value="./"/>
59+
<!-- Directory containing the Paths config file -->
60+
<const name="CONFIGPATH" value="./app/Config/"/>
61+
<!-- Directory containing the front controller (index.php) -->
62+
<const name="PUBLICPATH" value="./public/"/>
63+
</php>
6364
</phpunit>

public/index.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
*/
2828

2929
// Path to the front controller (this file)
30-
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
30+
define('FCPATH', __DIR__ . '/');
3131

3232
// Ensure the current directory is pointing to the front controller's directory
33-
if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
33+
if (getcwd() . '/' !== FCPATH) {
3434
chdir(FCPATH);
3535
}
3636

@@ -43,6 +43,20 @@
4343
* and fires up an environment-specific bootstrapping.
4444
*/
4545

46+
/**
47+
* A real path with identical slashes in Unix/Windows
48+
*/
49+
function _realpath(string $path): bool|string
50+
{
51+
$realPath = realpath($path);
52+
53+
if (! $realPath) {
54+
return false;
55+
}
56+
57+
return str_replace('\\', '/', $realPath);
58+
}
59+
4660
// LOAD OUR PATHS CONFIG FILE
4761
// This is the line that might need to be changed, depending on your folder structure.
4862
require FCPATH . '../app/Config/Paths.php';

0 commit comments

Comments
 (0)