Reorganizes tests folder structure
parent
5327bde032
commit
f0b487ca36
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/ratelimiter.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/includes/rate_limit_middleware.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/ratelimiter.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/includes/rate_limit_middleware.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/includes/session_middleware.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/includes/session_middleware.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace Tests\Framework\Integration\Security;
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/log.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/helpers/security.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/log.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/helpers/security.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -4,7 +4,7 @@ namespace Tests\Framework\Integration\Security;
|
|||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/includes/security_headers_middleware.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/includes/security_headers_middleware.php';
|
||||
|
||||
class SecurityHeadersTest extends TestCase
|
||||
{
|
|
@ -6,20 +6,25 @@ This directory contains the test suite for the Jilo Web application. All testing
|
|||
|
||||
```
|
||||
tests/
|
||||
├── framework/ # Test framework files
|
||||
│ ├── composer.json # Composer configuration for tests
|
||||
│ ├── phpunit.xml # PHPUnit configuration
|
||||
│ ├── Unit/ # Unit tests
|
||||
│ ├── Integration/ # Integration tests
|
||||
│ └── TestCase.php # Base test case class
|
||||
└── README.md # This file
|
||||
├── Unit/ # Unit tests (individual classes and methods)
|
||||
├── Classes/
|
||||
└── Helpers/
|
||||
├── Feature/ # Feature (integration) tests (covering multiple components)
|
||||
├── Midleware/
|
||||
└── Security/
|
||||
├── Functional/ # Functionl tests (real usage scenarios)
|
||||
├── Utils/ # Custom test utilities and libraries
|
||||
├── TestCase.php # Base test case class
|
||||
├── composer.json # Composer configuration for tests
|
||||
├── phpunit.xml # PHPUnit configuration
|
||||
└── README.md # This file
|
||||
```
|
||||
|
||||
## Running Tests
|
||||
|
||||
1. Change to the framework directory:
|
||||
1. Change to the test framework directory:
|
||||
```bash
|
||||
cd tests/framework
|
||||
cd tests
|
||||
```
|
||||
|
||||
2. Install dependencies (first time only):
|
||||
|
@ -37,4 +42,4 @@ composer test
|
|||
composer test-coverage
|
||||
```
|
||||
|
||||
The coverage report will be generated in `tests/framework/coverage/`.
|
||||
The coverage report will be generated in `tests/coverage/`.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/agent.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/agent.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/feedback.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/feedback.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/host.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/host.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/server.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/server.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/log.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/log.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/platform.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/platform.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/ratelimiter.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/log.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/ratelimiter.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/log.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/settings.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/settings.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/user.php';
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/ratelimiter.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/database.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/user.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/ratelimiter.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/classes/validator.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/classes/validator.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 4) . '/app/helpers/security.php';
|
||||
require_once dirname(__DIR__, 3) . '/app/helpers/security.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -12,21 +12,21 @@
|
|||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"../../app/includes/errors.php",
|
||||
"../../app/classes/database.php",
|
||||
"../../app/classes/agent.php",
|
||||
"../../app/classes/host.php",
|
||||
"../../app/classes/platform.php",
|
||||
"../../app/classes/server.php",
|
||||
"../../app/classes/log.php",
|
||||
"../../app/classes/feedback.php",
|
||||
"../../app/classes/settings.php",
|
||||
"../../app/classes/validator.php",
|
||||
"../../app/classes/router.php",
|
||||
"../../app/classes/ratelimiter.php",
|
||||
"../../app/classes/user.php",
|
||||
"../../app/helpers/security.php",
|
||||
"../../app/includes/errors.php"
|
||||
"../app/includes/errors.php",
|
||||
"../app/classes/database.php",
|
||||
"../app/classes/agent.php",
|
||||
"../app/classes/host.php",
|
||||
"../app/classes/platform.php",
|
||||
"../app/classes/server.php",
|
||||
"../app/classes/log.php",
|
||||
"../app/classes/feedback.php",
|
||||
"../app/classes/settings.php",
|
||||
"../app/classes/validator.php",
|
||||
"../app/classes/router.php",
|
||||
"../app/classes/ratelimiter.php",
|
||||
"../app/classes/user.php",
|
||||
"../app/helpers/security.php",
|
||||
"../app/includes/errors.php"
|
||||
],
|
||||
"classmap": [
|
||||
"TestCase.php"
|
|
@ -8,17 +8,20 @@
|
|||
<testsuite name="Unit">
|
||||
<directory suffix="Test.php">./Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Integration">
|
||||
<directory suffix="Test.php">./Integration</directory>
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./Feature</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Functional">
|
||||
<directory suffix="Test.php">./Functional</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">../../app</directory>
|
||||
<directory suffix=".php">../app</directory>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory>../../app/templates</directory>
|
||||
<directory>../../app/includes</directory>
|
||||
<directory>../app/templates</directory>
|
||||
<directory>../app/includes</directory>
|
||||
</exclude>
|
||||
</coverage>
|
||||
<php>
|
Loading…
Reference in New Issue