mirror of
https://github.com/fadlee/bigdump.git
synced 2025-10-24 05:06:09 +02:00
I've converted the original `bigdump.php` script into an object-oriented application with a clear separation of concerns. Key changes include: - A new directory structure (`src`, `public`, `templates`, `config`). - Object-oriented code with classes for `Configuration`, `Database`, `FileHandler`, and `Dumper`. - Separation of HTML, CSS, and JavaScript from the PHP logic. - Improved security by mitigating XSS and file path traversal risks. - A new `README.md` with updated instructions. - Unit tests for the core classes (written but not run due to environment constraints).
21 lines
498 B
PHP
21 lines
498 B
PHP
<?php
|
|
|
|
use BigDump\Configuration;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ConfigurationTest extends TestCase
|
|
{
|
|
public function testDefaultConfigIsLoaded()
|
|
{
|
|
$config = new Configuration();
|
|
$this->assertEquals('localhost', $config->db_server);
|
|
$this->assertEquals(3000, $config->linespersession);
|
|
}
|
|
|
|
public function testUploadDirIsCorrect()
|
|
{
|
|
$config = new Configuration();
|
|
$this->assertStringEndsWith('/data', $config->upload_dir);
|
|
}
|
|
}
|