Integration Test Cases
MementoTest.testDirectMementoResponse
TestDescription: Ensure that the oldid (URI-M) page has the correct Memento headers.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = false (default)
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response contains Memento-Datetime header
- response's Link header contains a timegate relation
- response's Link header's timegate relation contains the correct URI
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
TestDescription: Ensure that the oldid (URI-M) page has the correct Memento headers. Ensure that when recommended relations are turned on, those additional entries in the Link header show up and are correct.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = true
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response contains Memento-Datetime header
- response's Link header contains a timegate relation
- response's Link header's timegate relation contains the correct URI
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
- depending the number of mementos for this resource
- response's Link header contains a first memento relation and response's Link header contains a last memento relation, and these relations point the correct URIs
- -OR-
- response's Link header contains a first last memento relation, and these relations point to the correct URIs
MementoTest.testDirectOriginalResourceResponse
TestDescription: Ensure that the article (URI-R) page has the correct Memento headers.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = false (default)
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response's Link header contains a timegate relation
- response's Link header's timegate relation contains the correct URI
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
TestDescription: Ensure that the article (URI-R) page has the correct Memento headers. Ensure that when recommended relations are turned on, those additional entries in the Link header show up and are correct.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = true
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response's Link header contains a timegate relation
- response's Link header's timegate relation contains the correct URI
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
- depending the number of mementos for this resource
- response's Link header contains a first memento relation and response's Link header contains a last memento relation, and these relations point the correct URIs
- -OR-
- response's Link header contains a first last memento relation, and these relations point to the correct URIs
MementoTest.test302StyleTimeGateResponse
TestDescription: Ensure that the TimeGate (URI-G) response has the correct Memento headers.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = false (default)
- $wgMementoTimeNegotiation = 302 (default)
Test Verification Steps
- response contains 302 status code
- response contains Link header
- response contains Vary header
- response contains Location header
- Location header contains correct oldid page URI (URI-M)
- Vary header contains the entry Accept-Datetime
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
- response contains no entity
TestDescription: Ensure that the TimeGate (URI-G) response has the correct Memento headers. Ensure that when recommended relations are turned on, those additional entries in the Link header show up and are correct.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = true
- $wgMementoTimeNegotiation = 302 (default)
Test Verification Steps
- response contains 302 status code
- response contains Link header
- response contains Vary header
- response contains Location header
- Location header contains correct oldid page URI (URI-M)
- Vary header contains the entry Accept-Datetime
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- response contains no PHP errors, notices, or warnings
- response contains no entity
- depending the number of mementos for this resource
- response's Link header contains a first memento relation and response's Link header contains a last memento relation, and these relations point the correct URIs
- -OR-
- response's Link header contains a first last memento relation, and these relations point to the correct URIs
MementoTest.test200StyleTimeGateMementoResponse
TestDescription: Ensure that the TimeGate (URI-G) response has the correct Memento headers when the original resource and TimeGate are the same URI.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = false (default)
- $wgMementoTimeNegotiation = 200
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response contains Memento-Datetime header
- response contains Vary header
- response contains Content-Location header
- Content-Location header contains correct oldid page URI (URI-M)
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- Vary header contains the entry Accept-Datetime
- response contains no PHP errors, notices, or warnings
TestDescription: Ensure that the TimeGate (URI-G) response has the correct Memento headers when the original resource and TimeGate are the same URI. Ensure that when recommended relations are turned on, those additional entries in the Link header show up and are correct.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoRecommendedRelations = true
- $wgMementoTimeNegotiation = 200
Test Verification Steps
- response contains 200 status code
- response contains Link header
- response contains Memento-Datetime header
- response contains Vary header
- response contains Content-Location header
- Content-Location header contains correct oldid page URI (URI-M)
- response's Link header contains a original latest-version relation
- response's Link header's original latest-version relation contains the correct URI
- response's Link header contains a timemap relation
- response's Link header's timemap relation contains the correct URI
- Vary header contains the entry Accept-Datetime
- response contains no PHP errors, notices, or warnings
- depending the number of mementos for this resource
- response's Link header contains a first memento relation and response's Link header contains a last memento relation, and these relations point the correct URIs
- -OR-
- response's Link header contains a first last memento relation, and these relations point to the correct URIs
MementoTest.testEditPage
Test Description: Regression Test to ensure given Edit Page generates 200 status code and entity contains no PHP errors.
Requirements Source
Mediawiki Default Behavior (Regression)
Test Data File: memento-editpage-testdata.csv
Memento Mediawiki Extension Settings Required
Test verification steps
- Given URI response contains 200 status code
- Response entity body contains no PHP errors, notices, or warnings
MementoTest.testDiffPage
Test Description: Regression Test to ensure given Diff Page contains no errors
Requirements Source
- Mediawiki Default Behavior (Regression)
Test Data File: memento-diffpage-testdata.csv
Memento Mediawiki Extension Settings Required
Test Verification Steps
- Given URI response contains 200 status code
- Response entity body contains no PHP errors, notices, or warnings
ErrorStateTest.test400TimeGateTraditionalError
Test Description: Ensure that an incorrect Accept-Datetime value sent to a TimeGate generates a 400 status response with the correct error message.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoErrorPageType = 'traditional'
Test verification steps
- Given URI response contains 400 status code
- response contains Vary header
- Vary header contains the entry Accept-Datetime
- response contains no PHP errors, notices, or warnings
- response contains the correct error message for an invalid Accept-Datetime
ErrorStateTest.test400TimeGateFriendlyError
Test Description: Ensure that an incorrect Accept-Datetime value sent to a TimeGate generates a 200 status response with the correct error message.
Test Data File: time-negotiation-testdata.csv
Memento MediaWiki Extension Settings Required
- $wgMementoErrorPageType = 'friendly' (default)
Test verification steps
- Given URI response contains 200 status code
- response contains Vary header
- Vary header contains the entry Accept-Datetime
- response contains no PHP errors, notices, or warnings
- response contains the correct error message for an invalid Accept-Datetime
ErrorStateTest.test404TimeMapTraditionalError
Test Description: Ensure that an incorrect article name generates a 404 status response with the correct error message.
Test Data File: timemap-dneurls-testdata
Memento MediaWiki Extension Settings Required
- $wgMementoErrorPageType = 'traditional'
Test verification steps
- Given URI response contains 404 status code
- response contains no PHP errors, notices, or warnings
- response contains the correct message for an invalid article name
ErrorStateTest.test404TimeMapFriendlyError
Test Description: Ensure that an incorrect article name generates a 200 status response with the correct error message.
Test Data File: timemap-dneurls-testdata
Memento MediaWiki Extension Settings Required
- $wgMementoErrorPageType = 'friendly' (default)
Test verification steps
- Given URI response contains 404 status code
- response contains no PHP errors, notices, or warnings
- response contains the correct message for an invalid article name
Test Dataset Documentation
time-negotiation-testdata.csv
Fields:
- Identifier - Identifier for the test data entry
- Accept-Datetime - value passed in Accept-Datetime header for requests
- URI-R - original resource URI value
- original latest-version - expected value of the URI reference from the original latest-version relation in the Link header
- first memento - expected value of the URI reference from the first memento relation in the Link header
- last memento - expected value of the URI reference from the last memento relation in the Link header
- prev predecessor-version memento - expected value of the URI reference from the prev predecessor-version memento relation in the Link header
- next successor-version memento - expected value of the URI reference from the next successor-version memento relation in the Link header
- URI-M - expected URI value for the memento relation
- URI-G - expected URI value for the timegate relation (only used for tests with 302-style negotiation)
- Comment - comment on row in dataset indicating why it was chosen
memento-diffpage-testdata.csv
This dataset just contains a newline-separated list of diff pages to use for regression testing.
memento-editpage-testdata.csv
This dataset just contains a newline-separated list of edit pages to use for regression testing.
timegate-dneurls-testdata.csv
This dataset contains a newline-separated list of TimeGate URIs that should not exist on the wiki for 404 testing.
timemap-dneurls-testdata.csv
This dataset contains a newline-separated list of URIs that should generate 404 errors.