Skip to content

EPubTest

Test for EPUB library

Source: https://github.com/splitbrain/php-epub-meta

  • Full name: \EPubTest
  • Parent class: TestCase

Constants

Constant Visibility Type Value
TEST_EPUB public DIR . '/data/test.epub'
TEST_EPUB_COPY public DIR . '/data/test.copy.epub'
TEST_EPUB_COVER public DIR . '/data/test.cover.epub'
TEST_IMAGE public DIR . '/data/test.jpg'
EMPTY_ZIP public DIR . '/data/empty.zip'
BROKEN_ZIP public DIR . '/data/broken.zip'
MARKUP_XML_1 public DIR . '/data/markup.1.xml'
MARKUP_XML_2 public DIR . '/data/markup.2.xml'
MARKUP_XML_3 public DIR . '/data/markup.3.xml'
MARKUP_XML_4 public DIR . '/data/markup.4.xml'
MARKUP_XML_5 public DIR . '/data/markup.5.xml'

Properties

epub

protected \SebLucas\EPubMeta\EPub $epub

Methods

setUp

protected setUp(): void

tearDown

protected tearDown(): void

testGetZipEntries

public testGetZipEntries(): void

testLoadNonZip

public testLoadNonZip(): void

testLoadBrokenZip

public testLoadBrokenZip(): void

testLoadMissingFile

public testLoadMissingFile(): void

testLoadDirectory

We cannot expect a more specific exception message. ZipArchive::open returns 28 which is not known as an error code.

public testLoadDirectory(): void

testLoadEmptyZip

public testLoadEmptyZip(): void

testFilename

public testFilename(): void

testAuthors

public testAuthors(): void

testTitle

public testTitle(): void

testLanguage

public testLanguage(): void

testPublisher

public testPublisher(): void

testCopyright

public testCopyright(): void

testDescription

public testDescription(): void

testUniqueIdentifier

public testUniqueIdentifier(): void

testUuid

public testUuid(): void

testUri

public testUri(): void

testIsbn

public testIsbn(): void

testSubject

public testSubject(): void

testCover

public testCover(): void

testTitlePage

public testTitlePage(): void

Throws:


testCalibreAnnotations

public testCalibreAnnotations(): void

Throws:


testCalibreBookmarks

public testCalibreBookmarks(): void

Throws:


testManifest

public testManifest(): void

Throws:


testSpine

public testSpine(): void

Throws:


testToc

public testToc(): void

Throws:


testNav

public testNav(): void

Throws:


testNavTree

public testNavTree(): void

Throws:


testContents

public testContents(string $referenceStart, string $referenceEnd, int $referenceSize, bool $keepMarkup, float $fraction): void

Parameters:

Parameter Type Description
$referenceStart string The expected start of the extracted contents.
$referenceEnd string The expected end of the extracted contents.
$referenceSize int The expected size of the extracted contents.
$keepMarkup bool Whether to extract contents with or without HTML markup.
$fraction float

Throws:


provideContentsTestParameters

Summary of provideContentsTestParameters

public static provideContentsTestParameters(): array
  • This method is static.

testItemContents

public testItemContents(string $referenceStart, string $referenceEnd, string $spineIndex, string $fragmentBegin = null, string $fragmentEnd = null): void

Parameters:

Parameter Type Description
$referenceStart string The expected start of the extracted contents.
$referenceEnd string The expected end of the extracted contents.
$spineIndex string The spine index of the item to extract contents from.
$fragmentBegin string The anchor name (ID) where to start extraction.
$fragmentEnd string The anchor name (ID) where to end extraction.

Throws:


provideItemContentsTestParameters

Summary of provideItemContentsTestParameters

public static provideItemContentsTestParameters(): array
  • This method is static.

testItemContentsStartFragmentException

public testItemContentsStartFragmentException(): void

testItemContentsEndFragmentException

public testItemContentsEndFragmentException(): void

testItemContentsMarkup

public testItemContentsMarkup(string $referenceFile, string $spineIndex, string $fragmentBegin = null, string $fragmentEnd = null): void

Parameters:

Parameter Type Description
$referenceFile string
$spineIndex string
$fragmentBegin string
$fragmentEnd string

Throws:


provideItemContentsMarkupTestParameters

Summary of provideItemContentsMarkupTestParameters

public static provideItemContentsMarkupTestParameters(): array
  • This method is static.

testItemDataSize

public testItemDataSize(): void

Throws:


testZipEdit

Summary of testZipEdit

public testZipEdit(): void


Automatically generated on 2025-03-18