Module talk:Mock title/testcases

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

checkY All tests passed.

Name Expected Actual
checkY test MockTitle: when no argument table is supplied, an error is raised
checkY test MockTitle: when no title argument is supplied, an error is raised
checkY test MockTitle: when using page name "Example", the prefixedText property equals the page name
checkY test MockTitle: when using page name "fr:Example", the prefixedText property equals the page name
checkY test MockTitle: when using page name "Module:Sandbox", the prefixedText property equals the page name
checkY test MockTitle: when using page name "Module:Sandbox/subpage", the prefixedText property equals the page name
checkY test MockTitle: when using page name "mw:Test", the prefixedText property equals the page name
checkY test MockTitle: when using page name "fr:b:Example", the prefixedText property equals the page name
checkY test MockTitle: property id is mocked using the id option
checkY test MockTitle: property isRedirect is mocked using the isRedirect option
checkY test MockTitle: property exists is mocked using the exists option
checkY test MockTitle: property contentModel is mocked using the contentModel option
checkY test MockTitle: passing a page name to the redirectTarget option causes redirectTarget to be a MockTitle object with that page name
checkY test MockTitle: passing an ID to the redirectTarget option causes redirectTarget to be a MockTitle object with that ID
checkY test MockTitle: passing an options table to the redirectTarget option causes redirectTarget to be a MockTitle object with those options
checkY test MockTitle: passing a MockTitle object to the redirectTarget option causes redirectTarget to be that MockTitle object
checkY test MockTitle: when setting option editProtection to "sysop", the protectionLevels table is updated accordingly
checkY test MockTitle: when setting option moveProtection to "sysop", the protectionLevels table is updated accordingly
checkY test MockTitle: when setting option createProtection to "sysop", the protectionLevels table is updated accordingly
checkY test MockTitle: when setting option uploadProtection to "sysop", the protectionLevels table is updated accordingly
checkY test MockTitle: when setting option cascadingEditProtection to "sysop", and when setting the cascadingProtectionSources option, the cascadingProtection table is updated accordingly
checkY test MockTitle: when setting option cascadingMoveProtection to "sysop", and when setting the cascadingProtectionSources option, the cascadingProtection table is updated accordingly
checkY test MockTitle: when setting option cascadingCreateProtection to "sysop", and when setting the cascadingProtectionSources option, the cascadingProtection table is updated accordingly
checkY test MockTitle: when setting option cascadingUploadProtection to "sysop", and when setting the cascadingProtectionSources option, the cascadingProtection table is updated accordingly
checkY test MockTitle: when a cascading protection argument is given, but no cascading protection sources are given, an error is raised
checkY test MockTitle: when a cascading protection argument is given, but the cascading protection sources table is empty, an error is raised
checkY test MockTitle: when cascading protection sources are given, but no cascading protection argument is given, an error is raised
checkY test MockTitle: if the content option is provided, getContent() returns the specified string
checkY test MockTitle: when setting option fileExists to "true", the file table is updated accordingly
checkY test MockTitle: when setting option fileWidth to "123", the file table is updated accordingly
checkY test MockTitle: when setting option fileHeight to "456", the file table is updated accordingly
checkY test MockTitle: when setting option filePages to "table", the file table is updated accordingly
checkY test MockTitle: when setting option fileSize to "1024", the file table is updated accordingly
checkY test MockTitle: when setting option fileMimeType to "image/png", the file table is updated accordingly
checkY test MockTitle: when setting option fileLength to "60", the file table is updated accordingly
checkY test MockTitle: when setting fileExists in a non-file namespace, no file table is set
checkY test MockTitle: when using page "Non-existent article tr9w78ebna0", the fileExists property is not set
checkY test MockTitle: when using page "Talk:Non-existent talk page 34hdbe0pafj", the fileExists property is not set
checkY test MockTitle: when using page "File:Non-existent file 341gh87fgg8", the fileExists property is set
checkY test MockTitle: when using page "Media:Non-existent file pbfhrw3v8d", the fileExists property is set
checkY test MockTitle: if no id option is specified, the real id value is used
checkY test MockTitle: if no isRedirect option is specified, the real isRedirect value is used
checkY test MockTitle: if no exists option is specified, the real exists value is used
checkY test MockTitle: if no contentModel option is specified, the real contentModel value is used
checkY test MockTitle: if no redirectTarget option is specified, the real redirectTarget value is used
checkY test MockTitle: if no editProtection option is specified, the real protectionLevels value is used
checkY test MockTitle: if no redirectTarget option is specified, the real redirectTarget value is used
checkY test MockTitle: if no cascadingEditProtection option is specified, the real cascadingProtection value is used
checkY test MockTitle: if no cascadingProtectionSources option is specified, the real cascadingProtection value is used
checkY test MockTitle: if no content option is specified, getContent() returns the the real content
checkY test MockTitle: the content property is not shared between mock objects
checkY test patchTitleObject: patchTitleObject returns an equivalent object to MockTitle when used on the same title
checkY test patchTitleObject: title arguments are ignored
checkY test registerMockTitle: real titles are used during patching when no mocks are registered
checkY test registerMockTitle: mocks are registered when specified using option table
checkY test registerMockTitle: mocks are registered when specified using mock title
checkY test registerMockCurrentTitle: mocks are registered when specified using option table
checkY test registerMockCurrentTitle: mocks are registered when specified using mock title
checkY test deregisterMockTitle: previously registered titles are not deregistered if a deregistration function is not called
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by title
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by args table
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by ID
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by title object
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by mock title object
checkY test deregisterMockCurrentTitle: the previously registered current title is not deregistered if a deregistration function is not called
checkY test deregisterMockCurrentTitle: the previously registered current title is deregistered if deregisterMockCurrentTitle is called
checkY test registerMockTitles: mocks are registered when specified using option table
checkY test registerMockTitles: mocks are registered when specified using mock title
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by title
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by args table
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by ID
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by title object
checkY test deregisterMockTitle: previously registered titles are deregistered when specified by mock title object
checkY test clearMockTitleRegistry: all mock titles are cleared
checkY test clearAllMockTitles: all registered titles are deregistered when clearAllMockTitles is called
checkY test registered mocks do not share content with standalone mocks when title constructors are patched
checkY test patchTitleNew: new is patched when the func parameter is run
checkY test patchTitleNew: new is not patched before the function is run
checkY test patchTitleNew: new is not patched after the function is run
checkY test patchMakeTitle: makeTitle is patched when the func parameter is run
checkY test patchMakeTitle: makeTitle is not patched before the function is run
checkY test patchMakeTitle: makeTitle is not patched after the function is run
checkY test patchGetCurrentTitle: getCurrentTitle is patched when the func parameter is run
checkY test patchGetCurrentTitle: getCurrentTitle is not patched before the function is run
checkY test patchGetCurrentTitle: getCurrentTitle is not patched after the function is run
checkY test patchTitleConstructors: all title constructors are patched when the func parameter is run
checkY test patchTitleConstructors: title constructors are not patched after the function is run
checkY test patchTitleNew: varargs are passed as arguments to the func parameter
checkY test patchTitleNew: the result of func is returned
checkY test patchMakeTitle: varargs are passed as arguments to the func parameter
checkY test patchMakeTitle: the result of func is returned
checkY test patchGetCurrentTitle: varargs are passed as arguments to the func parameter
checkY test patchGetCurrentTitle: the result of func is returned
checkY test patchTitleConstructors: varargs are passed as arguments to the func parameter
checkY test patchTitleConstructors: the result of func is returned