From fe30b5497593dcfb4445d72c99fa357011cebf46 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 7 Nov 2024 19:23:35 +0100 Subject: Update php-epub-meta and use composer for dep handling. Note that we upgrade to the 2.x branch of the dependency, as the 3.x branch requires PHP version 8.2 or later. There's no reason for us to move our minimum supported version of PHP just yet. --- vendor/maennchen/zipstream-php/test/Assertions.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 vendor/maennchen/zipstream-php/test/Assertions.php (limited to 'vendor/maennchen/zipstream-php/test/Assertions.php') diff --git a/vendor/maennchen/zipstream-php/test/Assertions.php b/vendor/maennchen/zipstream-php/test/Assertions.php new file mode 100644 index 000000000..8d7670eff --- /dev/null +++ b/vendor/maennchen/zipstream-php/test/Assertions.php @@ -0,0 +1,49 @@ +fail("File {$filePath} must contain {$needle}"); + } + + protected function assertFileDoesNotContain(string $filePath, string $needle): void + { + $last = ''; + + $handle = fopen($filePath, 'r'); + while (!feof($handle)) { + $line = fgets($handle, 1024); + + if (str_contains($last . $line, $needle)) { + fclose($handle); + + $this->fail("File {$filePath} must not contain {$needle}"); + } + + $last = $line; + } + + fclose($handle); + } +} -- cgit v1.2.3