Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | List of all members
SMW\Test\SemanticMediaWikiTestCase Class Reference
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=array())
 
 getSubject ($namespace=NS_MAIN)
 
 newSubject (Title $title=null)
 
 newSettings (array $settings=array())
 
 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

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
SMW\Test\SemanticMediaWikiTestCase::getClass ( )
abstract

Returns the name of the deriving class being tested

Since
1.9
Returns
string
SMW\Test\SemanticMediaWikiTestCase::getLanguage (   $langCode = 'en')
protected

Helper method that returns a Language object

Since
1.9
Returns
Language
SMW\Test\SemanticMediaWikiTestCase::getStore ( )
protected
SMW\Test\SemanticMediaWikiTestCase::getSubject (   $namespace = NS_MAIN)
protected

Helper method that returns a randomized DIWikiPage object

Since
1.9
Parameters
$namespace
Returns
DIWikiPage
SMW\Test\SemanticMediaWikiTestCase::getUser ( )
protected

Helper method that returns a User object

Since
1.9
Returns
User
SMW\Test\SemanticMediaWikiTestCase::newContext (   $request = array())
protected

Returns RequestContext object

Parameters
array$params
Returns
RequestContext
SMW\Test\SemanticMediaWikiTestCase::newDependencyBuilder ( DependencyContainer  $dependencyContainer = null)

Helper method that returns a SimpleDependencyBuilder object

Since
1.9
Parameters
DependencyContainer$dependencyContainer
Returns
SimpleDependencyBuilder
SMW\Test\SemanticMediaWikiTestCase::newMockBuilder ( )

Helper method that returns a MockObjectBuilder object

Since
1.9
Returns
MockObjectBuilder
SMW\Test\SemanticMediaWikiTestCase::newMockUser ( )
protected

Helper method that returns a User object

Since
1.9
Returns
User
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
SMW\Test\SemanticMediaWikiTestCase::newReflector (   $class = null)

Helper method that returns a ReflectionClass object

Since
1.9
Parameters
string | null$class
Returns
ReflectionClass
SMW\Test\SemanticMediaWikiTestCase::newSettings ( array  $settings = array())
protected

Helper method that returns a Settings object

Since
1.9
Parameters
array$settings
Returns
Settings
SMW\Test\SemanticMediaWikiTestCase::newSubject ( Title  $title = null)
protected

Helper method that returns a DIWikiPage object

Since
1.9
Parameters
Title | null$title
Returns
DIWikiPage
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
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: