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

Public Member Functions

 executeTestCases ($file)
 
 jsonFileProvider ()
 
- Public Member Functions inherited from SMW\Tests\MwDBaseUnitTestCase
 run (\PHPUnit_Framework_TestResult $result=null)
 

Protected Member Functions

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

Protected Attributes

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

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

SMW\Tests\JsonTestCaseScriptRunner::canExecuteTestCasesFor (   $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
SMW\Tests\JsonTestCaseScriptRunner::changeGlobalSettingTo (   $key,
  $value 
)
protected
Since
2.2
Parameters
mixed$key
mixed$value
SMW\Tests\JsonTestCaseScriptRunner::checkEnvironmentToSkipCurrentTest ( JsonTestCaseFileHandler  $jsonTestCaseFileHandler)
protected
Since
2.2
Parameters
JsonTestCaseFileHandler$jsonTestCaseFileHandler
SMW\Tests\JsonTestCaseScriptRunner::createPagesFor ( array  $pages,
  $defaultNamespace 
)
protected
SMW\Tests\JsonTestCaseScriptRunner::createPagesFrom ( array  $pages,
  $defaultNamespace = NS_MAIN 
)
protected
Since
2.5
Parameters
array$pages
integer$defaultNamespace
SMW\Tests\JsonTestCaseScriptRunner::executeTestCases (   $file)
Test:
jsonFileProvider
SMW\Tests\JsonTestCaseScriptRunner::getAllowedTestCaseFiles ( )
protected
Returns
array
SMW\Tests\JsonTestCaseScriptRunner::getRequiredJsonTestCaseMinVersion ( )
protected
Returns
string
SMW\Tests\JsonTestCaseScriptRunner::getTestCaseLocation ( )
abstractprotected
Returns
string
SMW\Tests\JsonTestCaseScriptRunner::jsonFileProvider ( )
Returns
array
SMW\Tests\JsonTestCaseScriptRunner::runTestCaseFile ( JsonTestCaseFileHandler  $jsonTestCaseFileHandler)
abstractprotected
Parameters
JsonTestCaseFileHandler$jsonTestCaseFileHandler
SMW\Tests\JsonTestCaseScriptRunner::setUp ( )
protected
SMW\Tests\JsonTestCaseScriptRunner::tearDown ( )
protected

Member Data Documentation

SMW\Tests\JsonTestCaseScriptRunner::$connectorId = ''
protected
SMW\Tests\JsonTestCaseScriptRunner::$deletePagesOnTearDown = true
protected
SMW\Tests\JsonTestCaseScriptRunner::$searchByFileExtension = 'json'
protected

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