Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
PKPTestCase Class Reference
Inheritance diagram for PKPTestCase:
ArticleSearchIndexTest ArticleSearchTest AuthorizationPolicyTest CitationListTokenizerFilterTest ClassTypeDescriptionTest ConfigTest DatabaseTestCase DataObjectTest DispatcherTest EmbeddedServerTest FilterHelperTest FilterTest FormValidatorAlphaNumTest FormValidatorArrayCustomTest FormValidatorArrayTest FormValidatorCaptchaTest FormValidatorControlledVocabTest FormValidatorCustomTest FormValidatorEmailTest FormValidatorInSetTest FormValidatorLengthTest FormValidatorLocaleEmailTest FormValidatorLocaleTest FormValidatorPostTest FormValidatorRegExpTest FormValidatorTest FormValidatorUriTest FormValidatorUrlTest FunctionalSwordDepositTest HandlerValidatorRolesTest JSONTest MedraWebserviceTest MetadataDescriptionDummyAdapterTest MetadataDescriptionTest MetadataPropertyTest MetadataTypeDescriptionTest Nlm30CitationSchemaCitationAdapterTest Nlm30CitationSchemaCitationOutputFormatFilterTest Nlm30CitationSchemaFilterTestCase Nlm30NameSchemaPersonStringFilterTest Nlm30Openurl10CrosswalkFilterTest Nlm30XmlFilterTestCase O4DOIObjectCacheTest OAIMetadataFormat_DCTest PersonStringNlm30NameSchemaFilterTest PKPLocaleTest PKPRequestTest PKPRouterTestCase PolicySetTest PolicyTestCase PrimitiveTypeDescriptionTest PubObjectCacheTest SolrWebServiceTest StringTest TypeDescriptionFactoryTest ValidatorControlledVocabTest ValidatorDateTest ValidatorEmailTest ValidatorISSNTest ValidatorTypeDescriptionTest ValidatorUrlTest XMLTypeDescriptionTest

Public Member Functions

 getActualOutput ()
 

Protected Member Functions

 getMockedDAOs ()
 
 getMockedRegistryKeys ()
 
 setTestConfiguration ($config, $configPath= 'config')
 
 setUp ()
 
 tearDown ()
 

Detailed Description

Class that implements functionality common to all PKP unit test cases.

NB: PHPUnit 3.x requires PHP 5.2 or later so we can use PHP5 constructs.

Definition at line 27 of file PKPTestCase.inc.php.

Member Function Documentation

PKPTestCase::getActualOutput ( )
See Also
PHPUnit_Framework_TestCase::getActualOutput()

Definition at line 95 of file PKPTestCase.inc.php.

PKPTestCase::getMockedDAOs ( )
protected

Override this method if you want to backup/restore DAOs before/after the test.

Returns
array A list of DAO names to backup and restore.

Definition at line 35 of file PKPTestCase.inc.php.

Referenced by setUp(), and tearDown().

PKPTestCase::getMockedRegistryKeys ( )
protected

Override this method if you want to backup/restore registry entries before/after the test.

Returns
array A list of registry keys to backup and restore.

Definition at line 44 of file PKPTestCase.inc.php.

Referenced by setUp(), and tearDown().

PKPTestCase::setTestConfiguration (   $config,
  $configPath = 'config' 
)
protected

Set a non-default test configuration

Parameters
$configstring the id of the configuration to use
$configPathstring (optional) where to find the config file, default: 'config'
$dbConnect(optional) whether to try to re-connect the data base, default: true

Definition at line 110 of file PKPTestCase.inc.php.

References Config\getConfigFileName(), and Config\setConfigFileName().

Referenced by PKPRequestTest\testGetBaseUrl(), PKPRequestTest\testGetBaseUrlWithHostDetection(), PKPRouterTestCase\testGetIndexUrl(), PKPRouterTestCase\testGetIndexUrlRestful(), PKPRequestTest\testGetRequestPath(), PKPRequestTest\testGetRequestPathRestful(), PKPRequestTest\testGetRequestPathWithoutPathinfo(), PKPRequestTest\testGetRequestPathWithPathinfo(), DBConnectionTest\testInitCustomDBConnection(), DBConnectionTest\testInitPostgresDBConnection(), PKPPageRouterTest\testIsCacheableNotInstalled(), PKPPageRouterTest\testIsCacheableWithoutPathinfo(), PKPPageRouterTest\testIsCacheableWithoutPathinfoSuccess(), PKPPageRouterTest\testIsCacheableWithPathinfo(), PKPPageRouterTest\testIsCacheableWithPathinfoSuccess(), PKPPageRouterTest\testIsCacheableWithPost(), PKPRequestTest\testIsPathInfoEnabled1(), PKPRequestTest\testIsPathInfoEnabled2(), PKPRequestTest\testIsRestfulUrlsEnabled1(), PKPRequestTest\testIsRestfulUrlsEnabled2(), PKPPageRouterTest\testUrlWithoutPathinfoAndOverriddenBaseUrl(), PKPComponentRouterTest\testUrlWithoutPathinfoAndOverriddenBaseUrl(), PKPPageRouterTest\testUrlWithoutPathinfoAndSecondContextObjectIsNull(), PKPComponentRouterTest\testUrlWithoutPathinfoAndSecondContextObjectIsNull(), PKPPageRouterTest\testUrlWithPathinfo(), PKPComponentRouterTest\testUrlWithPathinfo(), PKPPageRouterTest\testUrlWithPathinfoAndOverriddenBaseUrl(), PKPComponentRouterTest\testUrlWithPathinfoAndOverriddenBaseUrl(), and PKPPageRouterTest\testUrlWithPathinfoAndOverriddenNewContext().

PKPTestCase::setUp ( )
protected
See Also
PHPUnit_Framework_TestCase::setUp()

Definition at line 51 of file PKPTestCase.inc.php.

References Registry\get(), DAORegistry\getDAO(), getMockedDAOs(), getMockedRegistryKeys(), and Config\setConfigFileName().

PKPTestCase::tearDown ( )
protected
See Also
PHPUnit_Framework_TestCase::tearDown()

Definition at line 80 of file PKPTestCase.inc.php.

References getMockedDAOs(), getMockedRegistryKeys(), DAORegistry\registerDAO(), and Registry\set().


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