Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: neznaika0 <[email protected]>
  • Loading branch information
neznaika0 committed Dec 14, 2024
1 parent 1b530cd commit 77b85c4
Show file tree
Hide file tree
Showing 61 changed files with 629 additions and 403 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
],
"metrics": "utils/vendor/bin/phpmetrics --config=phpmetrics.json",
"phpstan:baseline": "vendor/bin/phpstan analyse --ansi --generate-baseline=phpstan-baseline.php",
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi",
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi --memory-limit 2G",
"sa": "@analyze",
"style": "@cs-fix",
"test": "phpunit"
"test": "phpunit --no-coverage"
},
"scripts-descriptions": {
"analyze": "Run static analysis",
Expand Down
202 changes: 202 additions & 0 deletions errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
15) CodeIgniter\Files\FileCollectionTest::testResolveDirectorySymlink
ErrorException: symlink(): Permission denied

E:\www\CodeIgniterProjects\dev\tests\system\Files\FileCollectionTest.php:69

16) CodeIgniter\Files\FileCollectionTest::testResolveFileSymlink
ErrorException: symlink(): Permission denied

E:\www\CodeIgniterProjects\dev\tests\system\Files\FileCollectionTest.php:89

17) CodeIgniter\HTTP\Files\FileMovingTest::testStore
ErrorException: mkdir(): No such file or directory

E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:181
E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:135
E:\www\CodeIgniterProjects\dev\system\HTTP\Files\UploadedFile.php:355
E:\www\CodeIgniterProjects\dev\tests\system\HTTP\Files\FileMovingTest.php:213

18) CodeIgniter\Helpers\FilesystemHelperTest::testGetFilenamesWithSymlinks
ErrorException: symlink(): Permission denied

E:\www\CodeIgniterProjects\dev\tests\system\Helpers\FilesystemHelperTest.php:408

19) CodeIgniter\Helpers\FilesystemHelperTest::testGetFileNotThereInfo
TypeError: basename(): Argument #1 ($path) must be of type string, false given

E:\www\CodeIgniterProjects\dev\system\Helpers\filesystem_helper.php:322
E:\www\CodeIgniterProjects\dev\tests\system\Helpers\FilesystemHelperTest.php:525

20) CodeIgniter\Publisher\PublisherInputTest::testAddUri
CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate

E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:709
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:383
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:152
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:187
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:331
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherInputTest.php:140

21) CodeIgniter\Publisher\PublisherInputTest::testAddUris
CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate

E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:709
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:383
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:152
E:\www\CodeIgniterProjects\dev\system\HTTP\CURLRequest.php:187
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:331
E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:312
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherInputTest.php:150

22) CodeIgniter\Publisher\PublisherSupportTest::testWipe
CodeIgniter\Publisher\Exceptions\PublisherException: Destination is not on the allowed list of Publisher directories: "C:/Users/aleksandr/AppData/Local/Temp/2d8bc0469a5a/"

E:\www\CodeIgniterProjects\dev\system\Publisher\Publisher.php:183
E:\www\CodeIgniterProjects\dev\tests\system\Publisher\PublisherSupportTest.php:166

--

There were 6 failures:

1) CodeIgniter\CodeIgniterTest::testRun404OverrideControllerReturnsResponse
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
<!DOCTYPE html>\n
<html lang="en">\n
<head>\n
<meta charset="UTF-8">\n
<title>Welcome to CodeIgniter 4!</title>\n
<meta name="description" content="The small framework with powerful features">\n
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
...
</body>\n
</html>\n
\n
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
' [ASCII](length: 17399) contains "Oops" [ASCII](length: 4).

E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:164

2) CodeIgniter\CodeIgniterTest::testRun404OverrideReturnResponse
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
<!DOCTYPE html>\n
<html lang="en">\n
<head>\n
<meta charset="UTF-8">\n
<title>Welcome to CodeIgniter 4!</title>\n
<meta name="description" content="The small framework with powerful features">\n
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
...
</body>\n
</html>\n
\n
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
' [ASCII](length: 17400) contains "Oops" [ASCII](length: 4).

E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:182

3) CodeIgniter\CodeIgniterTest::testRun404OverrideByClosure
Failed asserting that '<!-- DEBUG-VIEW START 1 APPPATH/Views/welcome_message.php -->\n
<!DOCTYPE html>\n
<html lang="en">\n
<head>\n
<meta charset="UTF-8">\n
<title>Welcome to CodeIgniter 4!</title>\n
<meta name="description" content="The small framework with powerful features">\n
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
<link rel="shortcut icon" type="image/png" href="/favicon.ico">\n
...
</body>\n
</html>\n
\n
<!-- DEBUG-VIEW ENDED 1 APPPATH/Views/welcome_message.php -->\n
' [ASCII](length: 17365) contains "404 Override by Closure." [ASCII](length: 24).

E:\www\CodeIgniterProjects\dev\tests\system\CodeIgniterTest.php:203

4) CodeIgniter\Commands\Database\ShowTableInfoMockIOTest::testDbTableWithInputs
Failed asserting that '+-----------+----------+----------+----------+----------+------+\n
| hostname | database | username | DBDriver | DBPrefix | port |\n
+-----------+----------+----------+----------+----------+------+\n
| 127.0.0.1 | :memory: | | SQLite3 | db_ | 3306 |\n
+-----------+----------+----------+----------+----------+------+\n
\n
Here is the list of your database tables:\n
[0] db_migrations\n
[82] db_user\n
[83] db_job\n
[84] db_misc\n
[85] db_type_test\n
[86] db_empty\n
[87] db_secondary\n
[88] db_stringifypkey\n
[89] db_without_auto_increment\n
[90] db_ip_table\n
[92] db_foo\n
\n
Which table do you want to see? [0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92]: a\n
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
\n
Which table do you want to see? [0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92]: 0\n
\n
Data of Table "db_migrations":\n
\n
+----+----------------+--------------------+-------+---------------+------------+-------+\n
| id | version | class | group | namespace | time | batch |\n
+----+----------------+--------------------+-------+---------------+------------+-------+\n
| 14 | 20160428212500 | Tests\Support\D... | tests | Tests\Support | 1733827161 | 1 |\n
+----+----------------+--------------------+-------+---------------+------------+-------+\n
\n
' matches PCRE pattern "/Which table do you want to see\? \[0, 1, 2, 3, 4, 5, 6, 7, 8, 9.*?\]: a
The "Which table do you want to see\?" field must be one of: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.*?./".

E:\www\CodeIgniterProjects\dev\tests\system\Commands\Database\ShowTableInfoMockIOTest.php:63

5) CodeIgniter\Commands\Database\ShowTableInfoTest::testDbTableShow
Failed asserting that '+-----------+----------+----------+----------+----------+------+\n
| hostname | database | username | DBDriver | DBPrefix | port |\n
+-----------+----------+----------+----------+----------+------+\n
| 127.0.0.1 | :memory: | | SQLite3 | db_ | 3306 |\n
+-----------+----------+----------+----------+----------+------+\n
\n
The following is a list of the names of all database tables:\n
\n
+-----+---------------------------+-------------+---------------+\n
| ID | Table Name | Num of Rows | Num of Fields |\n
+-----+---------------------------+-------------+---------------+\n
| 1 | db_migrations | 1 | 7 |\n
| 93 | db_foo | 1 | 1 |\n
| 94 | db_user | 0 | 7 |\n
| 95 | db_job | 0 | 6 |\n
| 96 | db_misc | 0 | 3 |\n
| 97 | db_type_test | 0 | 21 |\n
| 98 | db_empty | 0 | 4 |\n
| 99 | db_secondary | 0 | 3 |\n
| 100 | db_stringifypkey | 0 | 2 |\n
| 101 | db_without_auto_increment | 0 | 2 |\n
| 102 | db_ip_table | 0 | 2 |\n
+-----+---------------------------+-------------+---------------+\n
\n
\n
' [ASCII](length: 1380) contains "+----+---------------------------+-------------+---------------+
| ID | Table Name | Num of Rows | Num of Fields |
+----+---------------------------+-------------+---------------+" [ASCII](length: 194).

E:\www\CodeIgniterProjects\dev\tests\system\Commands\Database\ShowTableInfoTest.php:103

6) CodeIgniter\Security\CheckPhpIniTest::testCheckIni
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
Array &0 [
- 'global' => '',
+ 'global' => '1',
'current' => '1',
'recommended' => '0',
'remark' => '',
]

E:\www\CodeIgniterProjects\dev\tests\system\Security\CheckPhpIniTest.php:37

121 changes: 61 additions & 60 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="system/Test/bootstrap.php"
backupGlobals="false"
beStrictAboutOutputDuringTests="true"
colors="true"
columns="max"
failOnRisky="true"
failOnWarning="true"
cacheDirectory="build/.phpunit.cache">
<coverage
includeUncoveredFiles="true"
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true">
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage/html" highLowerBound="80"/>
<text outputFile="build/coverage/coverage.txt"/>
</report>
</coverage>
<extensions>
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
<parameter name="time-limit" value="0.50" />
<parameter name="report-count" value="30" />
</bootstrap>
</extensions>
<testsuites>
<testsuite name="System">
<directory>tests/system</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">system</directory>
</include>
<exclude>
<directory>system/Commands/Generators/Views</directory>
<directory>system/Debug/Toolbar/Views</directory>
<directory>system/Pager/Views</directory>
<directory>system/ThirdParty</directory>
<directory>system/Validation/Views</directory>
<file>system/bootstrap.php</file>
<file>system/ComposerScripts.php</file>
<file>system/Config/Routes.php</file>
<file>system/Test/bootstrap.php</file>
<file>system/Test/ControllerTester.php</file>
<file>system/Test/FeatureTestCase.php</file>
</exclude>
</source>
<php>
<server name="app.baseURL" value="http://example.com/"/>
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>
<!-- Directory containing phpunit.xml -->
<const name="HOMEPATH" value="./"/>
<!-- Directory containing the Paths config file -->
<const name="CONFIGPATH" value="./app/Config/"/>
<!-- Directory containing the front controller (index.php) -->
<const name="PUBLICPATH" value="./public/"/>
</php>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
bootstrap="system/Test/bootstrap.php"
backupGlobals="false"
beStrictAboutOutputDuringTests="true"
colors="true"
columns="max"
failOnRisky="true"
failOnWarning="true"
cacheDirectory="build/.phpunit.cache"
>
<coverage
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="false"
>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage/html" highLowerBound="80"/>
<text outputFile="build/coverage/coverage.txt"/>
</report>
</coverage>
<extensions>
<bootstrap class="Nexus\PHPUnit\Tachycardia\TachycardiaExtension">
<parameter name="time-limit" value="0.50"/>
<parameter name="report-count" value="30"/>
</bootstrap>
</extensions>
<testsuites>
<testsuite name="System">
<directory>tests/system</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">system</directory>
</include>
<exclude>
<directory>system/Commands/Generators/Views</directory>
<directory>system/Debug/Toolbar/Views</directory>
<directory>system/Pager/Views</directory>
<directory>system/ThirdParty</directory>
<directory>system/Validation/Views</directory>
<file>system/bootstrap.php</file>
<file>system/ComposerScripts.php</file>
<file>system/Config/Routes.php</file>
<file>system/Test/bootstrap.php</file>
<file>system/Test/ControllerTester.php</file>
<file>system/Test/FeatureTestCase.php</file>
</exclude>
</source>
<php>
<server name="app.baseURL" value="http://example.com/"/>
<server name="CODEIGNITER_SCREAM_DEPRECATIONS" value="1"/>
<!-- Directory containing phpunit.xml -->
<const name="HOMEPATH" value="./"/>
<!-- Directory containing the Paths config file -->
<const name="CONFIGPATH" value="./app/Config/"/>
<!-- Directory containing the front controller (index.php) -->
<const name="PUBLICPATH" value="./public/"/>
</php>
</phpunit>
18 changes: 16 additions & 2 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
*/

// Path to the front controller (this file)
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
define('FCPATH', __DIR__ . '/');

// Ensure the current directory is pointing to the front controller's directory
if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) {
if (getcwd() . '/' !== FCPATH) {
chdir(FCPATH);
}

Expand All @@ -43,6 +43,20 @@
* and fires up an environment-specific bootstrapping.
*/

/**
* A real path with identical slashes in Unix/Windows
*/
function _realpath(string $path): bool|string
{
$realPath = realpath($path);

if (! $realPath) {
return false;
}

return str_replace('\\', '/', $realPath);
}

// LOAD OUR PATHS CONFIG FILE
// This is the line that might need to be changed, depending on your folder structure.
require FCPATH . '../app/Config/Paths.php';
Expand Down
Loading

0 comments on commit 77b85c4

Please sign in to comment.