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
Methods
setUp
tearDown
testGetZipEntries
testLoadNonZip
testLoadBrokenZip
testLoadMissingFile
testLoadDirectory
We cannot expect a more specific exception message. ZipArchive::open returns 28 which is not known as an error code.
testLoadEmptyZip
testFilename
testAuthors
testTitle
testLanguage
testPublisher
testCopyright
testDescription
testUniqueIdentifier
testUuid
testUri
testIsbn
testSubject
testCover
testTitlePage
Throws:
testCalibreAnnotations
Throws:
testCalibreBookmarks
Throws:
testManifest
Throws:
testSpine
Throws:
testToc
Throws:
testNav
Throws:
testNavTree
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
- 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
- This method is static.
testItemContentsStartFragmentException
testItemContentsEndFragmentException
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
- This method is static.
testItemDataSize
Throws:
testZipEdit
Summary of testZipEdit
Automatically generated on 2025-03-18