PHPUnit
PHPUnit TYPO3 extension
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Tx_Phpunit_Service_TestCaseService Class Reference
Inheritance diagram for Tx_Phpunit_Service_TestCaseService:

Public Member Functions

 injectUserSettingsService (Tx_Phpunit_Interface_UserSettingsService $service)
 
 __destruct ()
 
 findTestCaseFilesInDirectory ($directory)
 
 isTestCaseFileName ($path)
 
 isValidTestCaseClassName ($className)
 

Public Attributes

const BASE_TEST_CASE_CLASS_NAME = 'PHPUnit_Framework_TestCase'
 
const SELENIUM_BASE_TEST_CASE_CLASS_NAME = 'PHPUnit_Extensions_Selenium2TestCase'
 

Protected Member Functions

 isNotFixturesPath ($path)
 
 isHiddenMacFile ($fileName)
 
 classNameHasTestCaseSuffix ($className)
 
 classNameIsNonAbstractSubclassOfValidBaseTestCase ($className)
 

Protected Attributes

 $userSettingsService = NULL
 

Static Protected Attributes

static $testCaseFileSuffixes
 
static $testCaseClassNameSuffixes
 

Constructor & Destructor Documentation

Tx_Phpunit_Service_TestCaseService::__destruct ( )

The destructor.

Member Function Documentation

Tx_Phpunit_Service_TestCaseService::classNameHasTestCaseSuffix (   $className)
protected

Checks whether a class name has a name suffix that is allowed for test cases.

Parameters
string$classNamethe class name to check, must not be empty
Returns
bool whether the class name has a suffix that is supported for test cases
Tx_Phpunit_Service_TestCaseService::classNameIsNonAbstractSubclassOfValidBaseTestCase (   $className)
protected

Checks whether $className is the name of a non-abstract subclass of the test case base class.

This function also checks for Selenium test cases whether Selenium tests are enabled in the user settings.

Parameters
string$classNamethe class name to check, must not be empty
Returns
bool whether the corresponding class is both non-abstract and a subclass of the test case base class
Tx_Phpunit_Service_TestCaseService::findTestCaseFilesInDirectory (   $directory)

Finds all files that are named like test files in the directory $directory and recursively all its subdirectories.

Parameters
string$directorythe absolute path of the directory in which to look for test cases
Returns
string[] sorted file names of the test cases in the directory $directory relative to $directory, will be empty if no test cases have been found
Exceptions
InvalidArgumentException
Tx_Phpunit_Service_TestCaseService::injectUserSettingsService ( Tx_Phpunit_Interface_UserSettingsService  $service)

Injects the user settings service.

Parameters
Tx_Phpunit_Interface_UserSettingsService$servicethe service to inject
Returns
void
Tx_Phpunit_Service_TestCaseService::isHiddenMacFile (   $fileName)
protected

Checks whether $fileName is a hidden Mac file.

Parameters
string$fileNamebase name of a file to check
Returns
bool TRUE if $fileName is a hidden Mac file, FALSE otherwise
Tx_Phpunit_Service_TestCaseService::isNotFixturesPath (   $path)
protected

Checks that a path does not contain "Fixtures" or "fixtures".

Parameters
string$paththe absolute path of a file to check, may be empty
Returns
bool TRUE if $fileName is a valid test case path, FALSE otherwise
Tx_Phpunit_Service_TestCaseService::isTestCaseFileName (   $path)

Checks whether a file name is named like a test case file name should be.

Parameters
string$paththe absolute path of a file to check
Returns
bool TRUE if $fileName is names like a proper test case, FALSE otherwise
Tx_Phpunit_Service_TestCaseService::isValidTestCaseClassName (   $className)

Checks whether $className is the name of a valid test case class, i.e., whether it follows the naming guidelines, is a subclass of one of the test base classes, is not one of the base classes itself and is not abstract.

Parameters
string$classNamethe class name to check, must not be empty
Returns
bool whether $className is the name of a valid test case class
Exceptions
InvalidArgumentException

Member Data Documentation

Tx_Phpunit_Service_TestCaseService::$testCaseClassNameSuffixes
staticprotected
Initial value:
= array(
'Test',
'_testcase',
)
Tx_Phpunit_Service_TestCaseService::$testCaseFileSuffixes
staticprotected
Initial value:
= array(
'Test.php',
'test.php',
'_testcase.php',
'testcase.php',
)

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