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

Public Member Functions

 testCaseFile ( $file)
 
 jsonFileProvider ()
 
- Public Member Functions inherited from SMW\Tests\DatabaseTestCase
 run (?\PHPUnit_Framework_TestResult $result=null)
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 getTestCaseLocation ()
 
 runTestCaseFile (JsonTestCaseFileHandler $jsonTestCaseFileHandler)
 
 getRequiredJsonTestCaseMinVersion ()
 
 getAllowedTestCaseFiles ()
 
 getDependencyDefinitions ()
 
 getPermittedSettings ()
 
 registerConfigValueCallback ( $key, \Closure $callback)
 
 getConfigValueCallback ( $key)
 
 canTestCaseFile ( $file)
 
 changeGlobalSettingTo ( $key, $value)
 
 checkEnvironmentToSkipCurrentTest (JsonTestCaseFileHandler $jsonTestCaseFileHandler)
 
 createPagesFrom (array $pages, $defaultNamespace=NS_MAIN)
 
 createPagesFor (array $pages, $defaultNamespace)
 
- Protected Member Functions inherited from SMW\Tests\DatabaseTestCase
 setUp ()
 
 tearDown ()
 
 removeDatabaseTypeFromTest ( $databaseToBeExcluded)
 
 destroyDatabaseTablesAfterRun ()
 
 getStore ()
 
 setStoresToBeExcluded (array $storesToBeExcluded)
 
 skipTestForMediaWikiVersionLowerThan ( $version, $message='')
 
 skipTestForDatabase ( $excludedDatabase, $message='')
 
 skipTestForStore ( $excludeStore)
 
 getDBConnection ()
 
 getConnectionProvider ()
 
 isUsableUnitTestDatabase ()
 
 checkIfDatabaseCanBeUsedOtherwiseSkipTest ()
 
 checkIfStoreCanBeUsedOtherwiseSkipTest ()
 

Protected Attributes

 $deletePagesOnTearDown = true
 
 $searchByFileExtension = 'json'
 
 $connectorId = ''
 
- Protected Attributes inherited from SMW\Tests\DatabaseTestCase
 $testEnvironment
 
 $testDatabaseTableBuilder
 
 $databaseToBeExcluded = null
 
 $storesToBeExcluded = null
 
 $destroyDatabaseTablesBeforeRun = false
 
 $destroyDatabaseTablesAfterRun = false
 
 $isUsableUnitTestDatabase = true
 

Additional Inherited Members

- Static Public Member Functions inherited from SMW\Tests\DatabaseTestCase
static setUpBeforeClass ()
 

Detailed Description

The JsonTestCaseScriptRunner is a convenience provider for Json formatted integration tests to allow writing tests quicker without the need to setup or tear down specific data structures.

The JSON format should make it also possible for novice user to understand what sort of tests are run as the content is based on wikitext rather than native PHP.

semantic-mediawiki medium

GNU GPL v2+

Since
2.2
Author
mwjames

Member Function Documentation

◆ canTestCaseFile()

SMW\Tests\JsonTestCaseScriptRunner::canTestCaseFile (   $file)
protected

Normally returns TRUE but can act on the list retrieved from JsonTestCaseScriptRunner::getAllowedTestCaseFiles (or hereof) to filter selected files and help fine tune a setup or debug a potential issue without having to run all test files at once.

Parameters
string$file
Returns
boolean

◆ changeGlobalSettingTo()

SMW\Tests\JsonTestCaseScriptRunner::changeGlobalSettingTo (   $key,
  $value 
)
protected
Since
2.2
Parameters
mixed$key
mixed$value

◆ checkEnvironmentToSkipCurrentTest()

SMW\Tests\JsonTestCaseScriptRunner::checkEnvironmentToSkipCurrentTest ( JsonTestCaseFileHandler  $jsonTestCaseFileHandler)
protected
Since
2.2
Parameters
JsonTestCaseFileHandler$jsonTestCaseFileHandler

◆ createPagesFor()

SMW\Tests\JsonTestCaseScriptRunner::createPagesFor ( array  $pages,
  $defaultNamespace 
)
protected

◆ createPagesFrom()

SMW\Tests\JsonTestCaseScriptRunner::createPagesFrom ( array  $pages,
  $defaultNamespace = NS_MAIN 
)
protected
Since
2.5
Parameters
array$pages
integer$defaultNamespace

◆ getAllowedTestCaseFiles()

SMW\Tests\JsonTestCaseScriptRunner::getAllowedTestCaseFiles ( )
protected
Returns
array

◆ getConfigValueCallback()

SMW\Tests\JsonTestCaseScriptRunner::getConfigValueCallback (   $key)
protected
Returns
callable|null

◆ getDependencyDefinitions()

SMW\Tests\JsonTestCaseScriptRunner::getDependencyDefinitions ( )
protected
Since
3.0
Returns
[]

◆ getPermittedSettings()

SMW\Tests\JsonTestCaseScriptRunner::getPermittedSettings ( )
protected

Selected list of settings (internal or MediaWiki related) that are permissible for the time of the test run to be manipulated.

For a configuration that requires special treatment (i.e. where a simple assignment isn't sufficient), a callback can be assigned to a settings key in order to sort out required manipulation (constants etc.).

Returns
array

◆ getRequiredJsonTestCaseMinVersion()

SMW\Tests\JsonTestCaseScriptRunner::getRequiredJsonTestCaseMinVersion ( )
protected
Returns
string

◆ getTestCaseLocation()

SMW\Tests\JsonTestCaseScriptRunner::getTestCaseLocation ( )
abstractprotected
Returns
string

◆ jsonFileProvider()

SMW\Tests\JsonTestCaseScriptRunner::jsonFileProvider ( )
Returns
array

◆ registerConfigValueCallback()

SMW\Tests\JsonTestCaseScriptRunner::registerConfigValueCallback (   $key,
\Closure  $callback 
)
protected
Parameters
string$key
Closure$callback

◆ runTestCaseFile()

SMW\Tests\JsonTestCaseScriptRunner::runTestCaseFile ( JsonTestCaseFileHandler  $jsonTestCaseFileHandler)
abstractprotected
Parameters
JsonTestCaseFileHandler$jsonTestCaseFileHandler

◆ testCaseFile()

SMW\Tests\JsonTestCaseScriptRunner::testCaseFile (   $file)

jsonFileProvider


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

About | General disclaimer | Privacy policy