Public Member Functions | |
| __construct (&$dom, &$css, &$path, $language_domain= 'en', $options=null) | |
| loadServices () | |
| getReport () | |
| getSeverity () | |
| addReport ($element=null, $message=null, $pass=null) | |
| getPath ($file) | |
| translation () | |
| getAllElements ($tags=null, $options=false, $value=true) | |
| elementHasChild ($element, $child_tag) | |
| getElementAncestor ($element, $ancestor_tag, $limit_tag= 'body') | |
| getElementsByAttribute ($tag, $attribute, $unique=false) | |
| getNextElement ($element) | |
| propertyIsEqual ($object, $property, $value, $trim=false, $lower=false) | |
| getParent ($element, $tag_name, $limiter) | |
| imageIsAnimated ($filename) | |
| elementContainsReadableText ($element) | |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Definition at line 24 of file test.php.
| quailTest::__construct | ( | &$ | dom, | |
| &$ | css, | |||
| &$ | path, | |||
| $ | language_domain = 'en', |
|||
| $ | options = null | |||
| ) |
The class constructor. We pass items by reference so we can alter the DOM if necessary
| object | $dom The DOMDocument object | |
| object | $css The QuailCSS object | |
| array | $path The path of this request | |
| string | $language_domain The langauge domain to user | |
| mixed | $options Any additional options passed by QUAIL. |
Definition at line 91 of file test.php.
References loadServices().
| quailTest::addReport | ( | $ | element = null, |
|
| $ | message = null, |
|||
| $ | pass = null | |||
| ) |
Adds a new QuailReportItem to this current tests collection of reports. Most reports pertain to a particular element (like an IMG with no Alt attribute); however, some are document-level and just either pass or don't pass
| object | $element The DOMElement object that pertains to this report | |
| string | $message An additional message to add to the report | |
| bool | $pass Whether or not this report passed |
Definition at line 144 of file test.php.
Referenced by bodyColorContrast::check(), bodyWaiErtColorContrast::check(), inputTabIndex::check(), inputHasLabel::check(), quailHeaderTest::check(), quailTagTest::check(), textIsNotSmall::check(), selectJumpMenus::check(), imgAltTextNotRedundant::check(), labelsAreAssignedToAnInput::check(), headersHaveText::check(), documentIsWrittenClearly::check(), videosEmbeddedOrLinkedNeedCaptions::check(), svgContainsTitle::check(), tabularDataIsInTable::check(), tableWithMoreHeadersUseID::check(), tableWithBothHeadersUseScope::check(), tableUsesCaption::check(), tableUsesAbbreviationForHeader::check(), tableUseColGroup::check(), tableSummaryIsSufficient::check(), tableSummaryIsEmpty::check(), tableSummaryDoesNotDuplicateCaption::check(), tableSummaryDescribesTable::check(), tableLayoutMakesSenseLinearized::check(), tableLayoutHasNoSummary::check(), tableLayoutHasNoCaption::check(), tableLayoutDataShouldNotHaveTh::check(), tableIsGrouped::check(), tableHeaderLabelMustBeTerse::check(), tableDataShouldHaveTh::check(), tableComplexHasSummary::check(), tabIndexFollowsLogicalOrder::check(), skipToContentLinkProvided::check(), siteMap::check(), selectWithOptionsHasOptgroup::check(), selectDoesNotChangeContext::check(), scriptOnmousemove::check(), scriptOnclickRequiresOnKeypress::check(), scriptInBodyMustHaveNoscript::check(), radioMarkedWithFieldgroupAndLegend::check(), radioLabelIsNearby::check(), preShouldNotBeUsedForTabularLayout::check(), passwordLabelIsNearby::check(), pNotUsedAsHeader::check(), objectWithClassIDHasNoText::check(), objectMustHaveValidTitle::check(), objectMustHaveTitle::check(), objectMustHaveEmbed::check(), objectMustContainText::check(), objectLinkToMultimediaHasTextTranscript::check(), noframesSectionMustHaveTextEquivalent::check(), menuNotUsedToFormatText::check(), listNotUsedForFormatting::check(), linkUsedToDescribeNavigation::check(), linkUsedForAlternateContent::check(), legendTextNotPlaceholder::check(), legendTextNotEmpty::check(), labelMustNotBeEmpty::check(), labelMustBeUnique::check(), labelDoesNotContainInput::check(), inputTextValueNotEmpty::check(), inputTextHasValue::check(), inputImageNotDecorative::check(), inputImageHasAlt::check(), inputImageAltNotRedundant::check(), inputImageAltIsShort::check(), inputImageAltIsNotPlaceholder::check(), inputImageAltIsNotFileName::check(), inputImageAltIdentifiesPurpose::check(), inputElementsDontHaveAlt::check(), inputDoesNotUseColorAlone::check(), inputCheckboxRequiresFieldset::check(), imgWithMathShouldHaveMathEquivalent::check(), imgWithMapHasUseMap::check(), imgShouldNotHaveTitle::check(), imgServerSideMapNotUsed::check(), imgNotReferredToByColorAlone::check(), imgNonDecorativeHasAlt::check(), imgNeedsLongDescWDlink::check(), imgMapAreasHaveDuplicateLink::check(), imgImportantNoSpacerAlt::check(), imgHasLongDesc::check(), imgHasAlt::check(), imgGifNoFlicker::check(), imgAltNotPlaceHolder::check(), imgAltNotEmptyInAnchor::check(), imgAltIsTooLong::check(), imgAltIsSameInText::check(), imgAltIsDifferent::check(), imgAltIdentifiesLinkDestination::check(), imgAltEmptyForDecorativeImages::check(), imageMapServerSide::check(), iframeMustNotHaveLongdesc::check(), headersUseToMarkSections::check(), framesetMustHaveNoFramesSection::check(), framesHaveATitle::check(), frameTitlesNotPlaceholder::check(), frameTitlesNotEmpty::check(), frameTitlesDescribeFunction::check(), frameSrcIsAccessible::check(), frameRelationshipsMustBeDescribed::check(), formWithRequiredLabel::check(), formDeleteIsReversable::check(), fileLabelIsNearby::check(), emoticonsExcessiveUse::check(), embedMustNotHaveEmptyAlt::check(), embedMustHaveAltAttribute::check(), embedHasAssociatedNoEmbed::check(), documentWordsNotInLanguageAreMarked::check(), documentVisualListsAreMarkedUp::check(), documentValidatesToDocType::check(), documentTitleNotEmpty::check(), documentTitleIsShort::check(), documentTitleIsNotPlaceholder::check(), documentTitleDescribesDocument::check(), documentStrictDocType::check(), documentReadingDirection::check(), documentMetaNotUsedWithTimeout::check(), documentLangNotIdentified::check(), documentLangIsISO639Standard::check(), documentIDsMustBeUnique::check(), documentHasTitleElement::check(), documentContentReadableWithoutStylesheets::check(), documentAutoRedirectNotUsed::check(), documentAllColorsAreSet::check(), documentAbbrIsUsed::check(), doctypeProvided::check(), cssTextHasContrast::check(), cssDocumentMakesSenseStyleTurnedOff::check(), checkboxLabelIsNearby::check(), bodyMustNotHaveBackground::check(), blockquoteUseForQuotations::check(), blockquoteNotUsedForIndentation::check(), areaLinksToSoundFile::check(), areaHasAltValue::check(), areaDontOpenNewWindow::check(), appletContainsTextEquivalentInAlt::check(), appletContainsTextEquivalent::check(), addressForAuthorMustBeValid::check(), addressForAuthor::check(), aTitleDescribesDestination::check(), aSuspiciousLinkText::check(), aMustNotHaveJavascriptHref::check(), aMustHaveTitle::check(), aMustContainText::check(), aMultimediaTextAlternative::check(), aLinksToSoundFilesNeedTranscripts::check(), aLinksToMultiMediaRequireTranscript::check(), aLinksMakeSenseOutOfContext::check(), aLinksDontOpenNewWindow::check(), aLinksAreSeperatedByPrintableCharacters::check(), aLinkTextDoesNotBeginWithRedundantWord::check(), aImgAltNotRepetative::check(), and aAdjacentWithSameResourceShouldBeCombined::check().
| quailTest::elementContainsReadableText | ( | $ | element | ) |
Returns if there are any printable/readable characters within an element. This finds both node values or images with alt text.
| object | $element The given element to look at |
Definition at line 377 of file test.php.
Referenced by headersHaveText::check(), labelMustNotBeEmpty::check(), and aMustContainText::check().
| quailTest::elementHasChild | ( | $ | element, | |
| $ | child_tag | |||
| ) |
Returns true if an element has a child with a given tag name
| object | $element A DOMElement object | |
| string | $child_tag The tag name of the child to find |
Definition at line 229 of file test.php.
Referenced by tableUseColGroup::check(), tableSummaryDoesNotDuplicateCaption::check(), tableLayoutHasNoSummary::check(), tableLayoutHasNoCaption::check(), tableIsGrouped::check(), objectMustHaveEmbed::check(), noframesSectionMustHaveTextEquivalent::check(), labelDoesNotContainInput::check(), framesetMustHaveNoFramesSection::check(), and formWithRequiredLabel::check().
| quailTest::getAllElements | ( | $ | tags = null, |
|
| $ | options = false, |
|||
| $ | value = true | |||
| ) |
Helper method to find all the elements that fit a particular query in the document (either by tag name, or by attributes from the htmlElements object)
| mixed | $tags Either a single tag name in a string, or an array of tag names | |
| string | $options The kind of option to select an element by (see htmlElements) | |
| string | $value The value of the above option |
Definition at line 200 of file test.php.
References htmlElements::getElementsByOption().
Referenced by bodyColorContrast::check(), bodyWaiErtColorContrast::check(), inputTabIndex::check(), inputHasLabel::check(), quailTagTest::check(), textIsNotSmall::check(), selectJumpMenus::check(), imgAltTextNotRedundant::check(), labelsAreAssignedToAnInput::check(), headersHaveText::check(), documentIsWrittenClearly::check(), videosEmbeddedOrLinkedNeedCaptions::check(), svgContainsTitle::check(), tabularDataIsInTable::check(), tableWithMoreHeadersUseID::check(), tableWithBothHeadersUseScope::check(), tableUsesCaption::check(), tableUsesAbbreviationForHeader::check(), tableUseColGroup::check(), tableSummaryIsSufficient::check(), tableSummaryIsEmpty::check(), tableSummaryDoesNotDuplicateCaption::check(), tableSummaryDescribesTable::check(), tableLayoutMakesSenseLinearized::check(), tableLayoutHasNoSummary::check(), tableLayoutHasNoCaption::check(), tableLayoutDataShouldNotHaveTh::check(), tableIsGrouped::check(), tableHeaderLabelMustBeTerse::check(), tableDataShouldHaveTh::check(), tableComplexHasSummary::check(), tabIndexFollowsLogicalOrder::check(), skipToContentLinkProvided::check(), siteMap::check(), selectWithOptionsHasOptgroup::check(), selectDoesNotChangeContext::check(), scriptOnmousemove::check(), scriptOnclickRequiresOnKeypress::check(), scriptInBodyMustHaveNoscript::check(), radioMarkedWithFieldgroupAndLegend::check(), radioLabelIsNearby::check(), preShouldNotBeUsedForTabularLayout::check(), passwordLabelIsNearby::check(), pNotUsedAsHeader::check(), objectWithClassIDHasNoText::check(), objectMustHaveValidTitle::check(), objectMustHaveTitle::check(), objectMustHaveEmbed::check(), objectMustContainText::check(), objectLinkToMultimediaHasTextTranscript::check(), noframesSectionMustHaveTextEquivalent::check(), menuNotUsedToFormatText::check(), listNotUsedForFormatting::check(), linkUsedToDescribeNavigation::check(), linkUsedForAlternateContent::check(), legendTextNotPlaceholder::check(), legendTextNotEmpty::check(), labelMustNotBeEmpty::check(), labelMustBeUnique::check(), labelDoesNotContainInput::check(), inputTextValueNotEmpty::check(), inputTextHasValue::check(), inputImageNotDecorative::check(), inputImageHasAlt::check(), inputImageAltNotRedundant::check(), inputImageAltIsShort::check(), inputImageAltIsNotPlaceholder::check(), inputImageAltIsNotFileName::check(), inputImageAltIdentifiesPurpose::check(), inputElementsDontHaveAlt::check(), inputDoesNotUseColorAlone::check(), inputCheckboxRequiresFieldset::check(), imgWithMathShouldHaveMathEquivalent::check(), imgWithMapHasUseMap::check(), imgShouldNotHaveTitle::check(), imgServerSideMapNotUsed::check(), imgNotReferredToByColorAlone::check(), imgNonDecorativeHasAlt::check(), imgNeedsLongDescWDlink::check(), imgMapAreasHaveDuplicateLink::check(), imgImportantNoSpacerAlt::check(), imgHasLongDesc::check(), imgHasAlt::check(), imgGifNoFlicker::check(), imgAltNotPlaceHolder::check(), imgAltNotEmptyInAnchor::check(), imgAltIsTooLong::check(), imgAltIsSameInText::check(), imgAltIsDifferent::check(), imgAltIdentifiesLinkDestination::check(), imgAltEmptyForDecorativeImages::check(), imageMapServerSide::check(), iframeMustNotHaveLongdesc::check(), headersUseToMarkSections::check(), framesetMustHaveNoFramesSection::check(), framesHaveATitle::check(), frameTitlesNotPlaceholder::check(), frameTitlesNotEmpty::check(), frameTitlesDescribeFunction::check(), frameSrcIsAccessible::check(), frameRelationshipsMustBeDescribed::check(), formWithRequiredLabel::check(), formDeleteIsReversable::check(), fileLabelIsNearby::check(), emoticonsExcessiveUse::check(), embedMustNotHaveEmptyAlt::check(), embedMustHaveAltAttribute::check(), embedHasAssociatedNoEmbed::check(), documentWordsNotInLanguageAreMarked::check(), documentVisualListsAreMarkedUp::check(), documentMetaNotUsedWithTimeout::check(), documentContentReadableWithoutStylesheets::check(), documentAutoRedirectNotUsed::check(), documentAllColorsAreSet::check(), documentAbbrIsUsed::check(), cssDocumentMakesSenseStyleTurnedOff::check(), checkboxLabelIsNearby::check(), bodyMustNotHaveBackground::check(), blockquoteUseForQuotations::check(), blockquoteNotUsedForIndentation::check(), areaLinksToSoundFile::check(), areaHasAltValue::check(), areaDontOpenNewWindow::check(), appletContainsTextEquivalentInAlt::check(), appletContainsTextEquivalent::check(), addressForAuthorMustBeValid::check(), addressForAuthor::check(), aTitleDescribesDestination::check(), aSuspiciousLinkText::check(), aMustNotHaveJavascriptHref::check(), aMustHaveTitle::check(), aMustContainText::check(), aMultimediaTextAlternative::check(), aLinksToSoundFilesNeedTranscripts::check(), aLinksToMultiMediaRequireTranscript::check(), aLinksMakeSenseOutOfContext::check(), aLinksDontOpenNewWindow::check(), aLinksAreSeperatedByPrintableCharacters::check(), aLinkTextDoesNotBeginWithRedundantWord::check(), aImgAltNotRepetative::check(), aAdjacentWithSameResourceShouldBeCombined::check(), and getElementsByAttribute().
| quailTest::getElementAncestor | ( | $ | element, | |
| $ | ancestor_tag, | |||
| $ | limit_tag = 'body' | |||
| ) |
Returns the first ancestor reached of a tag, or false if it hits the document root or a given tag.
| object | $element A DOMElement object | |
| string | $ancestor_tag The name of the tag we are looking for | |
| string | $limit_tag Where to stop searching |
Definition at line 244 of file test.php.
Referenced by formWithRequiredLabel::check().
| quailTest::getElementsByAttribute | ( | $ | tag, | |
| $ | attribute, | |||
| $ | unique = false | |||
| ) |
Finds all the elements with a given tag name that has an attribute
| string | $tag The tag name to search for | |
| string | $attribute The attribute to search on | |
| bool | $unique Whether we only want one result per attribute |
Definition at line 267 of file test.php.
References getAllElements().
Referenced by imgMapAreasHaveDuplicateLink::check().
| quailTest::getNextElement | ( | $ | element | ) |
Returns the next element after the current one.
| object | $element A DOMElement object |
Definition at line 285 of file test.php.
Referenced by imgNeedsLongDescWDlink::check().
| quailTest::getParent | ( | $ | element, | |
| $ | tag_name, | |||
| $ | limiter | |||
| ) |
Returns the parent of an elment that has a given tag Name, but stops the search if it hits the $limiter tag
| object | $element The DOMElement object to search on | |
| string | $tag_name The name of the tag of the parent to find | |
| string | $limiter The tag name of the element to stop searching on regardless of the results (like search for a parent "P" tag of this node but stop if you reach "body") |
Definition at line 336 of file test.php.
Referenced by selectJumpMenus::check(), radioMarkedWithFieldgroupAndLegend::check(), inputCheckboxRequiresFieldset::check(), and formDeleteIsReversable::check().
| quailTest::getPath | ( | $ | file | ) |
Retrieves the full path for a file.
| string | $file The path to a file |
Definition at line 157 of file test.php.
Referenced by imgImportantNoSpacerAlt::check(), and imgGifNoFlicker::check().
| quailTest::getReport | ( | ) |
| quailTest::getSeverity | ( | ) |
| quailTest::imageIsAnimated | ( | $ | filename | ) |
Returns if a GIF files is animated or not http://us.php.net/manual/en/function.imagecreatefromgif.php#88005
| quailTest::loadServices | ( | ) |
If this test requires services, it loads the associated files and creates a new service instance locally.
Definition at line 109 of file test.php.
Referenced by __construct().
| quailTest::propertyIsEqual | ( | $ | object, | |
| $ | property, | |||
| $ | value, | |||
| $ | trim = false, |
|||
| $ | lower = false | |||
| ) |
To minimize notices, this compares an object's property to the valus and returns true or false. False will also be returned if the object is not really an object, or if the property doesn't exist at all
| object | $object The object too look at | |
| string | $property The name of the property | |
| mixed | $value The value to check against | |
| bool | $trim Whether the property value should be trimmed | |
| book | $lower Whether the property value should be compared on lower case |
Definition at line 307 of file test.php.
Referenced by svgContainsTitle::check(), tableWithMoreHeadersUseID::check(), tableWithBothHeadersUseScope::check(), tableUsesAbbreviationForHeader::check(), tableSummaryDoesNotDuplicateCaption::check(), tableLayoutHasNoSummary::check(), tableLayoutHasNoCaption::check(), tableIsGrouped::check(), tableHeaderLabelMustBeTerse::check(), selectWithOptionsHasOptgroup::check(), scriptInBodyMustHaveNoscript::check(), menuNotUsedToFormatText::check(), listNotUsedForFormatting::check(), linkUsedToDescribeNavigation::check(), linkUsedForAlternateContent::check(), imgWithMathShouldHaveMathEquivalent::check(), imgNeedsLongDescWDlink::check(), imgMapAreasHaveDuplicateLink::check(), imgAltNotEmptyInAnchor::check(), imgAltIdentifiesLinkDestination::check(), embedHasAssociatedNoEmbed::check(), addressForAuthorMustBeValid::check(), addressForAuthor::check(), aLinksAreSeperatedByPrintableCharacters::check(), aLinkTextDoesNotBeginWithRedundantWord::check(), aImgAltNotRepetative::check(), and aAdjacentWithSameResourceShouldBeCombined::check().
| quailTest::translation | ( | ) |
Returns a translated variable. If the translation is unavailable, English is returned Because tests only really have one string array, we can get all of this info locally
Definition at line 181 of file test.php.
Referenced by skipToContentLinkProvided::check(), objectMustHaveValidTitle::check(), inputImageAltNotRedundant::check(), inputImageAltIsNotPlaceholder::check(), imgAltNotPlaceHolder::check(), frameTitlesNotPlaceholder::check(), formDeleteIsReversable::check(), and aLinkTextDoesNotBeginWithRedundantWord::check().
1.5.7.1