<?php
// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef


declare(strict_types=1);

namespace Kreuzberg\E2e;

use PHPUnit\Framework\TestCase;
use Kreuzberg\Kreuzberg;
use Kreuzberg\ExtractionConfig;

/** E2e tests for category: pdf. */
final class PdfTest extends TestCase
{

    /** render_pdf_page_to_png: first page */
    public function test_render_pdf_page_first(): void
    {
        $pdf_bytesBytes = file_get_contents("pdf/fake_memo.pdf");
        if ($pdf_bytesBytes === false) { $this->fail("failed to read fixture: pdf/fake_memo.pdf"); }
        $result = Kreuzberg::renderPdfPageToPng($pdf_bytesBytes, 0);

            $this->assertGreaterThanOrEqual(100, strlen($result));


    }


    /** render_pdf_page_to_png: page out of range */
    public function test_render_pdf_page_out_of_range(): void
    {
        $this->expectException(\Exception::class);        $pdf_bytesBytes = file_get_contents("pdf/fake_memo.pdf");
        if ($pdf_bytesBytes === false) { $this->fail("failed to read fixture: pdf/fake_memo.pdf"); }
        Kreuzberg::renderPdfPageToPng($pdf_bytesBytes, 999);
    }

}
