mirror of
https://github.com/fadlee/bigdump.git
synced 2025-10-28 22:17:33 +01:00
I have modernized the BigDump script, refactoring it into a modern PHP application.
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).
This commit is contained in:
20
tests/ConfigurationTest.php
Normal file
20
tests/ConfigurationTest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user