Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Lingo\Tests\Unit\ElementTest Class Reference
Inheritance diagram for Lingo\Tests\Unit\ElementTest:
Inheritance graph
[legend]
Collaboration diagram for Lingo\Tests\Unit\ElementTest:
Collaboration graph
[legend]

Public Member Functions

 testCanConstruct ()
 
 testGetFormattedTerm_1 ()
 
 testGetFormattedTerm_2 ()
 
 testGetFormattedTerm_3 ()
 
 testGetFormattedTerm_4 ()
 
 testGetFormattedTerm_5 ()
 
 testGetFormattedTerm_6 ()
 
 testGetFormattedTerm_7 ()
 
 testGetFormattedDefinitions_1 ()
 
 testGetFormattedDefinitions_2 ()
 
 testGetFormattedDefinitions_3 ()
 
 testGetFormattedDefinitions_4 ()
 

Protected Member Functions

 setUp ()
 
 checkTermIsDomElement ( $node, $tagName, $text, $expectedAttributes=[], $unexpectedAttributes=[])
 

Protected Attributes

 $element
 
 $doc
 

Detailed Description

extensions-lingo extensions-lingo-unit mediawiki-databaseless

Member Function Documentation

◆ checkTermIsDomElement()

Lingo\Tests\Unit\ElementTest::checkTermIsDomElement (   $node,
  $tagName,
  $text,
  $expectedAttributes = [],
  $unexpectedAttributes = [] 
)
protected
Parameters
\DOMElement$node
string$tagName
string$text
string[]$expectedAttributes
array$unexpectedAttributes

◆ testCanConstruct()

Lingo\Tests\Unit\ElementTest::testCanConstruct ( )

::__construct

◆ testGetFormattedDefinitions_1()

Lingo\Tests\Unit\ElementTest::testGetFormattedDefinitions_1 ( )

Tests

  • correct html is produced
  • correct order of definitions
  • user-defined class is applied to definition

◆ testGetFormattedDefinitions_2()

Lingo\Tests\Unit\ElementTest::testGetFormattedDefinitions_2 ( )

Tests

  • if there is no link defined, no link is added to the list of definitions
  • if there is an invalid link, an error message is attached to the list of definitions and the link is omitted

◆ testGetFormattedDefinitions_3()

Lingo\Tests\Unit\ElementTest::testGetFormattedDefinitions_3 ( )

Tests

  • if there is only one definition and its text is empty and it has a link, no definitions are produced

◆ testGetFormattedDefinitions_4()

Lingo\Tests\Unit\ElementTest::testGetFormattedDefinitions_4 ( )

Tests

  • if there is only one definition and its text is empty and it has an invalid link, the error message shows as tooltip
  • class 'invalid-link-target' is correctly applied to error message
  • if the term contains HTML-special characters, it is handled without raising an exception

◆ testGetFormattedTerm_1()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_1 ( )

Tests

  • if $wgexLingoDisplayOnce = false, the first and second occurrence of a term is correctly marked up as tooltip anchor

◆ testGetFormattedTerm_2()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_2 ( )

Tests

  • if $wgexLingoDisplayOnce = true, the first occurrence of a term is correctly marked up as tooltip anchor
  • if $wgexLingoDisplayOnce = true, the second occurrence of a term is not marked up

◆ testGetFormattedTerm_3()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_3 ( )

Tests

  • if there is only one definition and its text is empty and it has a link, the term is marked up as link
  • if the link is not a URL and does not point to an existing page, the term is marked up as "new" link
  • if $wgexLingoDisplayOnce = false, the first and second occurrence of of term are marked up as link

◆ testGetFormattedTerm_4()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_4 ( )

Tests

  • if the link is not a URL and points to an existing page, the term is marked up with that title

◆ testGetFormattedTerm_5()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_5 ( )

Tests

  • if there is only one definition and its text is empty and it has a link and $wgexLingoDisplayOnce = true, the first occurrence of a term is correctly marked up as link
  • if there is only one definition and its text is empty and it has a link and $wgexLingoDisplayOnce = true, the second occurrence of a term is not marked up
  • if a style is set in the definition, the link is marked up with that style
  • if the link is a valid URL, the term is marked up as external link

◆ testGetFormattedTerm_6()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_6 ( )

Tests

  • if there is only one definition and its text is empty and it has an invalid link, the term is marked up as tooltip
  • if the term contains HTML-special characters, it is handled without raising an exception

◆ testGetFormattedTerm_7()

Lingo\Tests\Unit\ElementTest::testGetFormattedTerm_7 ( )

Tests

  • if there is only one definition and its text is empty and it has an anchor link, the term is marked up as link without title attribute

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy