/** * Locates a fixture and returns the Package * * @param string $name Partial path to fixture * * @return Package */ public function getFixtureEpub($name) { $fixture = $this->getFixturePath($name); $reader = new Reader(); $epub = $reader->load($fixture); return $epub; }
<?php require_once __DIR__ . '/../bootstrap.php'; use ePub\Reader; use ePub\Loader\ZipFileLoader; $reader = new Reader(); $epub = $reader->load($argv[1]); printf("Title: %s\n", $epub->getMetadata()->get('title'));
public function testReadingManifestItemContent() { $fixture = $this->getFixturePath('the_velveteen_rabbit.epub'); $reader = new Reader(); $epub = $reader->load($fixture); $manifest = $epub->getManifest(); $dedication = $manifest->get('dedication'); $expected = $this->getFixture('the-velveteen-rabbit/' . $dedication->href); $this->assertEquals($expected, $dedication->getContent()); }