Skip to main content

File downloads

DrevOps\BehatSteps\Steps\Web\FileDownloadTrait - Source, Steps

Test file download functionality with content verification.

public function fileDownloadAssertZipContainsFiles(array $names, bool $is_partial): void

Assert that the downloaded ZIP archive holds every named file

public function fileDownloadAssertZipNotContainsFiles(array $names, bool $is_partial): void

Assert that the downloaded ZIP archive holds none of the named files

public function fileDownloadFindLine(string $search): ?string

Find the first line of the downloaded file that contains a string

public function fileDownloadGetTempDir(): string

Get temp download dir

public function fileDownloadGetTimeout(): int

Get the time, in seconds, a file download may wait for data

public function fileDownloadLoad(string $url): void

Download a file and keep it as the scenario's download

public function fileDownloadOpenZip(): ZipArchive

Open downloaded ZIP archive and validate contents

public function fileDownloadProcess(string $url, array $options = []): array

Download file