Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
namespace Lwt\Tests\Modules\Dictionary\Infrastructure\Import;

use Lwt\Modules\Dictionary\Infrastructure\Import\ArchiveExtractor;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use ZipArchive;

/**
* @covers \Lwt\Modules\Dictionary\Infrastructure\Import\ArchiveExtractor
* Archive detection, extraction and cleanup, including the path-traversal
* guard and the nested-file search extraction relies on.
*/
#[CoversClass(ArchiveExtractor::class)]
class ArchiveExtractorTest extends TestCase
{
private string $sandbox;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
namespace Lwt\Tests\Modules\Dictionary\Infrastructure\Import;

use Lwt\Modules\Dictionary\Infrastructure\Import\CsvImporter;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use RuntimeException;

/**
* @covers \Lwt\Modules\Dictionary\Infrastructure\Import\CsvImporter
* What the importer does with a byte-order mark: UTF-8 is stripped from the
* first cell, UTF-16 and UTF-32 are refused with a message that says why.
*/
#[CoversClass(CsvImporter::class)]
class CsvImporterBomTest extends TestCase
{
private string $tmpDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
namespace Lwt\Tests\Modules\Dictionary\Infrastructure\Import;

use Lwt\Modules\Dictionary\Infrastructure\Import\CsvImporter;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;

/**
* @covers \Lwt\Modules\Dictionary\Infrastructure\Import\CsvImporter
* Whether a file is a CSV when the upload path has no extension, which is
* how PHP hands over $_FILES['file']['tmp_name'].
*/
#[CoversClass(CsvImporter::class)]
class CsvImporterCanImportTest extends TestCase
{
private string $tmpDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
namespace Lwt\Tests\Modules\Dictionary\Infrastructure\Import;

use Lwt\Modules\Dictionary\Infrastructure\Import\JsonImporter;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;

/**
* @covers \Lwt\Modules\Dictionary\Infrastructure\Import\JsonImporter
* Whether a file is JSON when the upload path has no extension, which is
* how PHP hands over $_FILES['file']['tmp_name'].
*/
#[CoversClass(JsonImporter::class)]
class JsonImporterCanImportTest extends TestCase
{
private string $tmpDir;
Expand Down