EDSTest
extends TestCase
in package
Uses
FixtureTrait, ReflectionTrait
EDS Record Driver Test Class
Tags
Table of Contents
- $defaultDriverConfig : array<string|int, mixed>
- Default test configuration
- getLinkUrlsProvider() : array<string|int, mixed>
- Data provider for testLinkUrls
- testExtractEbscoDataUndefinedMethod() : void
- Test extractEbscoData for an undefined method.
- testGetAccessLevel() : void
- Test getAccessLevel for a record.
- testGetCleanDOI() : void
- Test getCleanDOI for a record.
- testGetCleanDOIFromBibData() : void
- Test getCleanDOI for a record when DOI is in bib data.
- testGetContainerEndPage() : void
- Test getContainerEndPage for a record.
- testGetContainerEndPageNoData() : void
- Test getContainerEndPage for a record with page data available.
- testGetContainerIssue() : void
- Test getContainerIssue for a record.
- testGetContainerIssueWhenEmpty() : void
- Test getContainerIssue for a record when there is no data.
- testGetContainerStartPage() : void
- Test getContainerStartPage for a record.
- testGetContainerTitle() : void
- Test getContainerTitle for a record.
- testGetContainerTitleNoContainer() : void
- Test getContainerTitle for a record.
- testGetContainerVolume() : void
- Test getContainerVolume for a record.
- testGetContainerVolumeWhenEmpty() : void
- Test getContainerVolume for a record when there is none.
- testGetCustomLinks() : void
- Test getCustomLinks for a record.
- testGetDbLabel() : void
- Test getDbLabel for a record.
- testGetEbookLinkNoData() : void
- Test getEbookLink for a record.
- testGetEpubLink() : void
- Test getEpubLink for a record.
- testGetFormatsArticle() : void
- Test getFormats for an article record.
- testGetFormatsDissertation() : void
- Test getFormats for a dissertation record.
- testGetFormatsEbook() : void
- Test getFormats for an ebook record.
- testGetFormatsOtherFormat() : void
- Test getFormats for a unidentified format record.
- testGetFTCustomLinks() : void
- Test getFTCustomLinks for a record.
- testGetHTMLFullText() : void
- Test getHTMLFullText for a record.
- testGetISBNs() : void
- Test getISBNs.
- testGetISSNs() : void
- Test getISSNs.
- testGetItems() : void
- Test getItems for a record.
- testGetItemsAbstract() : void
- Test getItemsAbstract for a record.
- testGetItemsAuthors() : void
- Test getItemsAuthors for a record.
- testGetItemsFilteredCore() : void
- Test getItems filtering the data for a record.
- testGetItemsFilteredResultList() : void
- Test getItems filtering the data for a record.
- testGetItemsSorted() : void
- Test getItems sorting the data for a record.
- testGetItemsSubjects() : void
- Test getItemsSubjects for a record.
- testGetItemsTitle() : void
- Test getItemsTitle for a record.
- testGetItemsTitleSource() : void
- Test getItemsTitleSource for a record.
- testGetItemsWithInvalidConfig() : void
- Test getItems when invalid data is returned from EDS (i.e. not in the structure VuFind expected)
- testGetLanguages() : void
- Test getLanguages for a record.
- testGetLinkedFullTextLink() : void
- Test getLinkedFullTextLink for a record.
- testGetPdfLink() : void
- Test getPdfLink for a record.
- testGetPlacesOfPublication() : void
- Test getPlacesOfPublication for a record.
- testGetPLink() : void
- Test getPLink for a record.
- testGetPrimaryAuthors() : void
- Test getPrimaryAuthors for a record.
- testGetPublicationDates() : void
- Test getPublicationDates for a record.
- testGetPublicationDetails() : void
- Test getPublicationDetails for a record.
- testGetPublicationDetailsFromBib() : void
- Test getPublicationDetails for a record from the bib record.
- testGetPublicationDetailsNoDate() : void
- Test getPublicationDetails for a record with another data format.
- testGetPublicationDetailsUnMatchedFormat() : void
- Test getPublicationDetails for a record with an unmatched format.
- testGetPublishers() : void
- Test getPublishers for a record.
- testGetPubType() : void
- Test getPubType for a record.
- testGetPubTypeId() : void
- Test getPubTypeId for a record.
- testGetShortTitle() : void
- Test getShortTitle for a record.
- testGetShortTitleWhenNoTitle() : void
- Test getShortTitle for a record with no title.
- testGetSubtitle() : void
- Test getSubtitle for a record.
- testGetSubtitleWhenNoTitle() : void
- Test getSubtitle for a record when there is no title field.
- testGetThumbnail() : void
- Test getThumbnail for a record.
- testGetThumbnailWhenNoneReturned() : void
- Test getThumbnail for a record that has no image data.
- testGetTitle() : void
- Test getTitle for a record.
- testGetUniqueID() : void
- Test getUniqueID for a record.
- testHasEpubAvailable() : void
- Test hasEpubAvailable for a record.
- testHasHTMLFullTextAvailable() : void
- Test hasHTMLFullTextAvailable for a record.
- testHasLinkedFullTextAvailable() : void
- Test hasLinkedFullTextAvailable for a record.
- testHasPdfAvailable() : void
- Test hasPdfAvailable for a record.
- testHasPdfAvailableReturningFalse() : void
- Test hasPdfAvailable for a record when none is.
- testLinkUrls() : void
- Test linkUrls for a record.
- callMethod() : mixed
- Call protected or private method for side-effect and result.
- getDriver() : EDS
- Generate a new Eds driver to return responses set in a json fixture
- getFixture() : string
- Load a fixture file.
- getFixtureDir() : string
- Get the base directory containing fixtures.
- getFixturePath() : string
- Resolve fixture path.
- getJsonFixture() : array<string|int, mixed>
- Load a JSON fixture from file (using associative array return type).
- getProperty() : mixed
- Return protected or private property.
- setProperty() : void
- Set protected or private property.
Properties
$defaultDriverConfig
Default test configuration
protected
array<string|int, mixed>
$defaultDriverConfig
= ['General' => ['default_sort' => 'relevance'], 'ItemGlobalOrder' => []]
Methods
getLinkUrlsProvider()
Data provider for testLinkUrls
public
static getLinkUrlsProvider() : array<string|int, mixed>
Return values
array<string|int, mixed> —testExtractEbscoDataUndefinedMethod()
Test extractEbscoData for an undefined method.
public
testExtractEbscoDataUndefinedMethod() : void
Return values
void —testGetAccessLevel()
Test getAccessLevel for a record.
public
testGetAccessLevel() : void
Return values
void —testGetCleanDOI()
Test getCleanDOI for a record.
public
testGetCleanDOI() : void
Return values
void —testGetCleanDOIFromBibData()
Test getCleanDOI for a record when DOI is in bib data.
public
testGetCleanDOIFromBibData() : void
Return values
void —testGetContainerEndPage()
Test getContainerEndPage for a record.
public
testGetContainerEndPage() : void
Return values
void —testGetContainerEndPageNoData()
Test getContainerEndPage for a record with page data available.
public
testGetContainerEndPageNoData() : void
Return values
void —testGetContainerIssue()
Test getContainerIssue for a record.
public
testGetContainerIssue() : void
Return values
void —testGetContainerIssueWhenEmpty()
Test getContainerIssue for a record when there is no data.
public
testGetContainerIssueWhenEmpty() : void
Return values
void —testGetContainerStartPage()
Test getContainerStartPage for a record.
public
testGetContainerStartPage() : void
Return values
void —testGetContainerTitle()
Test getContainerTitle for a record.
public
testGetContainerTitle() : void
Return values
void —testGetContainerTitleNoContainer()
Test getContainerTitle for a record.
public
testGetContainerTitleNoContainer() : void
Return values
void —testGetContainerVolume()
Test getContainerVolume for a record.
public
testGetContainerVolume() : void
Return values
void —testGetContainerVolumeWhenEmpty()
Test getContainerVolume for a record when there is none.
public
testGetContainerVolumeWhenEmpty() : void
Return values
void —testGetCustomLinks()
Test getCustomLinks for a record.
public
testGetCustomLinks() : void
Return values
void —testGetDbLabel()
Test getDbLabel for a record.
public
testGetDbLabel() : void
Return values
void —testGetEbookLinkNoData()
Test getEbookLink for a record.
public
testGetEbookLinkNoData() : void
Return values
void —testGetEpubLink()
Test getEpubLink for a record.
public
testGetEpubLink() : void
Return values
void —testGetFormatsArticle()
Test getFormats for an article record.
public
testGetFormatsArticle() : void
Return values
void —testGetFormatsDissertation()
Test getFormats for a dissertation record.
public
testGetFormatsDissertation() : void
Return values
void —testGetFormatsEbook()
Test getFormats for an ebook record.
public
testGetFormatsEbook() : void
Return values
void —testGetFormatsOtherFormat()
Test getFormats for a unidentified format record.
public
testGetFormatsOtherFormat() : void
Return values
void —testGetFTCustomLinks()
Test getFTCustomLinks for a record.
public
testGetFTCustomLinks() : void
Return values
void —testGetHTMLFullText()
Test getHTMLFullText for a record.
public
testGetHTMLFullText() : void
Return values
void —testGetISBNs()
Test getISBNs.
public
testGetISBNs() : void
Return values
void —testGetISSNs()
Test getISSNs.
public
testGetISSNs() : void
Return values
void —testGetItems()
Test getItems for a record.
public
testGetItems() : void
Return values
void —testGetItemsAbstract()
Test getItemsAbstract for a record.
public
testGetItemsAbstract() : void
Return values
void —testGetItemsAuthors()
Test getItemsAuthors for a record.
public
testGetItemsAuthors() : void
Return values
void —testGetItemsFilteredCore()
Test getItems filtering the data for a record.
public
testGetItemsFilteredCore() : void
Return values
void —testGetItemsFilteredResultList()
Test getItems filtering the data for a record.
public
testGetItemsFilteredResultList() : void
Return values
void —testGetItemsSorted()
Test getItems sorting the data for a record.
public
testGetItemsSorted() : void
Return values
void —testGetItemsSubjects()
Test getItemsSubjects for a record.
public
testGetItemsSubjects() : void
Return values
void —testGetItemsTitle()
Test getItemsTitle for a record.
public
testGetItemsTitle() : void
Return values
void —testGetItemsTitleSource()
Test getItemsTitleSource for a record.
public
testGetItemsTitleSource() : void
Return values
void —testGetItemsWithInvalidConfig()
Test getItems when invalid data is returned from EDS (i.e. not in the structure VuFind expected)
public
testGetItemsWithInvalidConfig() : void
Return values
void —testGetLanguages()
Test getLanguages for a record.
public
testGetLanguages() : void
Return values
void —testGetLinkedFullTextLink()
Test getLinkedFullTextLink for a record.
public
testGetLinkedFullTextLink() : void
Return values
void —testGetPdfLink()
Test getPdfLink for a record.
public
testGetPdfLink() : void
Return values
void —testGetPlacesOfPublication()
Test getPlacesOfPublication for a record.
public
testGetPlacesOfPublication() : void
Return values
void —testGetPLink()
Test getPLink for a record.
public
testGetPLink() : void
Return values
void —testGetPrimaryAuthors()
Test getPrimaryAuthors for a record.
public
testGetPrimaryAuthors() : void
Return values
void —testGetPublicationDates()
Test getPublicationDates for a record.
public
testGetPublicationDates() : void
Return values
void —testGetPublicationDetails()
Test getPublicationDetails for a record.
public
testGetPublicationDetails() : void
Return values
void —testGetPublicationDetailsFromBib()
Test getPublicationDetails for a record from the bib record.
public
testGetPublicationDetailsFromBib() : void
Return values
void —testGetPublicationDetailsNoDate()
Test getPublicationDetails for a record with another data format.
public
testGetPublicationDetailsNoDate() : void
Return values
void —testGetPublicationDetailsUnMatchedFormat()
Test getPublicationDetails for a record with an unmatched format.
public
testGetPublicationDetailsUnMatchedFormat() : void
Return values
void —testGetPublishers()
Test getPublishers for a record.
public
testGetPublishers() : void
Return values
void —testGetPubType()
Test getPubType for a record.
public
testGetPubType() : void
Return values
void —testGetPubTypeId()
Test getPubTypeId for a record.
public
testGetPubTypeId() : void
Return values
void —testGetShortTitle()
Test getShortTitle for a record.
public
testGetShortTitle() : void
Return values
void —testGetShortTitleWhenNoTitle()
Test getShortTitle for a record with no title.
public
testGetShortTitleWhenNoTitle() : void
Return values
void —testGetSubtitle()
Test getSubtitle for a record.
public
testGetSubtitle() : void
Return values
void —testGetSubtitleWhenNoTitle()
Test getSubtitle for a record when there is no title field.
public
testGetSubtitleWhenNoTitle() : void
Return values
void —testGetThumbnail()
Test getThumbnail for a record.
public
testGetThumbnail() : void
Return values
void —testGetThumbnailWhenNoneReturned()
Test getThumbnail for a record that has no image data.
public
testGetThumbnailWhenNoneReturned() : void
Return values
void —testGetTitle()
Test getTitle for a record.
public
testGetTitle() : void
Return values
void —testGetUniqueID()
Test getUniqueID for a record.
public
testGetUniqueID() : void
Return values
void —testHasEpubAvailable()
Test hasEpubAvailable for a record.
public
testHasEpubAvailable() : void
Return values
void —testHasHTMLFullTextAvailable()
Test hasHTMLFullTextAvailable for a record.
public
testHasHTMLFullTextAvailable() : void
Return values
void —testHasLinkedFullTextAvailable()
Test hasLinkedFullTextAvailable for a record.
public
testHasLinkedFullTextAvailable() : void
Return values
void —testHasPdfAvailable()
Test hasPdfAvailable for a record.
public
testHasPdfAvailable() : void
Return values
void —testHasPdfAvailableReturningFalse()
Test hasPdfAvailable for a record when none is.
public
testHasPdfAvailableReturningFalse() : void
Return values
void —testLinkUrls()
Test linkUrls for a record.
public
testLinkUrls(string $url, string $expected) : void
Parameters
- $url : string
-
Input URL
- $expected : string
-
Expected value
Tags
Return values
void —callMethod()
Call protected or private method for side-effect and result.
protected
callMethod(object|string $object, string $method[, array<string|int, mixed> $arguments = [] ]) : mixed
Uses PHP's reflection API in order to modify method accessibility.
Parameters
- $object : object|string
-
Object or class name
- $method : string
-
Method name
- $arguments : array<string|int, mixed> = []
-
Method arguments
Tags
Return values
mixed —getDriver()
Generate a new Eds driver to return responses set in a json fixture
protected
getDriver([string $test = null ][, array<string|int, mixed> $config = null ]) : EDS
Overwrites $this->driver Uses session cache
Parameters
- $test : string = null
-
Name of test fixture to load
- $config : array<string|int, mixed> = null
-
Driver configuration (null to use default)
Return values
EDS —getFixture()
Load a fixture file.
protected
getFixture(string $filename[, string $module = 'VuFind' ]) : string
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Tags
Return values
string —getFixtureDir()
Get the base directory containing fixtures.
protected
getFixtureDir([string $module = 'VuFind' ]) : string
Parameters
- $module : string = 'VuFind'
-
Module containing fixture.
Return values
string —getFixturePath()
Resolve fixture path.
protected
getFixturePath(string $filename[, string $module = 'VuFind' ]) : string
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Tags
Return values
string —getJsonFixture()
Load a JSON fixture from file (using associative array return type).
protected
getJsonFixture(string $filename[, string $module = 'VuFind' ]) : array<string|int, mixed>
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Return values
array<string|int, mixed> —getProperty()
Return protected or private property.
protected
getProperty(object|string $object, string $property) : mixed
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
Tags
Return values
mixed —setProperty()
Set protected or private property.
protected
setProperty(object|string $object, string $property, mixed $value) : void
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
- $value : mixed
-
Property value