Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | List of all members
SMW\Test\SemanticMediaWikiTestCase Class Reference
Inheritance diagram for SMW\Test\SemanticMediaWikiTestCase:
Inheritance graph
[legend]
Collaboration diagram for SMW\Test\SemanticMediaWikiTestCase:
Collaboration graph
[legend]

Public Member Functions

 getClass ()
 
 newMockBuilder ()
 
 newDependencyBuilder (DependencyContainer $dependencyContainer=null)
 
 newReflector ( $class=null)
 

Protected Member Functions

 newTitle ( $namespace=NS_MAIN, $text=null)
 
 getUser ()
 
 newMockUser ()
 
 getLanguage ( $langCode='en')
 
 newContext ( $request=[])
 
 getSubject ( $namespace=NS_MAIN)
 
 newSubject (Title $title=null)
 
 newSettings (array $settings=[])
 
 newRandomString ( $length=10, $prefix=null)
 
 runOnlyOnSQLStore ( $store=null)
 
 getStore ()
 
 arrayWrap (array $elements)
 

Detailed Description

Class contains general purpose methods

SMW SMWExtension

GNU GPL v2+

Since
1.9
Author
mwjames

Member Function Documentation

◆ arrayWrap()

SMW\Test\SemanticMediaWikiTestCase::arrayWrap ( array  $elements)
protected

Utility method taking an array of elements and wrapping each element in it's own array. Useful for data providers that only return a single argument.

See also
MediaWikiTestCase::arrayWrap
Since
1.9
Parameters
array$elements
Returns
array

◆ getClass()

SMW\Test\SemanticMediaWikiTestCase::getClass ( )
abstract

Returns the name of the deriving class being tested

Since
1.9
Returns
string

◆ getLanguage()

SMW\Test\SemanticMediaWikiTestCase::getLanguage (   $langCode = 'en')
protected

Helper method that returns a Language object

Since
1.9
Returns
Language

◆ getSubject()

SMW\Test\SemanticMediaWikiTestCase::getSubject (   $namespace = NS_MAIN)
protected

Helper method that returns a randomized DIWikiPage object

Since
1.9
Parameters
$namespace
Returns
DIWikiPage

◆ getUser()

SMW\Test\SemanticMediaWikiTestCase::getUser ( )
protected

Helper method that returns a User object

Since
1.9
Returns
User

◆ newContext()

SMW\Test\SemanticMediaWikiTestCase::newContext (   $request = [])
protected

Returns RequestContext object

Parameters
array$params
Returns
RequestContext

◆ newDependencyBuilder()

SMW\Test\SemanticMediaWikiTestCase::newDependencyBuilder ( DependencyContainer  $dependencyContainer = null)

Helper method that returns a SimpleDependencyBuilder object

Since
1.9
Parameters
DependencyContainer$dependencyContainer
Returns
SimpleDependencyBuilder

◆ newMockBuilder()

SMW\Test\SemanticMediaWikiTestCase::newMockBuilder ( )

Helper method that returns a MockObjectBuilder object

Since
1.9
Returns
MockObjectBuilder

◆ newMockUser()

SMW\Test\SemanticMediaWikiTestCase::newMockUser ( )
protected

Helper method that returns a User object

Since
1.9
Returns
User

◆ newRandomString()

SMW\Test\SemanticMediaWikiTestCase::newRandomString (   $length = 10,
  $prefix = null 
)
protected

Helper method that returns a random string

Since
1.9
Parameters
$length
$prefixidentify a specific random string during testing
Returns
string

◆ newReflector()

SMW\Test\SemanticMediaWikiTestCase::newReflector (   $class = null)

Helper method that returns a ReflectionClass object

Since
1.9
Parameters
string | null$class
Returns
ReflectionClass

◆ newSettings()

SMW\Test\SemanticMediaWikiTestCase::newSettings ( array  $settings = [])
protected

Helper method that returns a Settings object

Since
1.9
Parameters
array$settings
Returns
Settings

◆ newSubject()

SMW\Test\SemanticMediaWikiTestCase::newSubject ( Title  $title = null)
protected

Helper method that returns a DIWikiPage object

Since
1.9
Parameters
Title | null$title
Returns
DIWikiPage

◆ newTitle()

SMW\Test\SemanticMediaWikiTestCase::newTitle (   $namespace = NS_MAIN,
  $text = null 
)
protected

Helper method that returns a randomized Title object to avoid results are influenced by cross instantiated objects with the same title name

Since
1.9
Parameters
$namespace
$text|null
Returns
Title

◆ runOnlyOnSQLStore()

SMW\Test\SemanticMediaWikiTestCase::runOnlyOnSQLStore (   $store = null)
protected

Helper method to skip the test if it is not a SQLStore

Since
1.9

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

About | General disclaimer | Privacy policy