PHP Class BrowscapTest\Data\DataCollectionTest

Author: James Titcumb ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Datei anzeigen Open project: browscap/browscap

Public Methods

Method Description
setUp ( ) Sets up the fixture, for example, open a network connection.
testAddDefaultBrowser ( ) checks if the default browser is added sucessfully
testAddDefaultProperties ( ) checks if the default properties are added sucessfully
testAddEnginesFileThrowsExceptionIfFileContainsInvalidJson ( ) tests if a specific exception is thrown in case of error while adding an engine json file
testAddEnginesFileThrowsExceptionIfFileContainsNoData ( )
testAddEnginesFileThrowsExceptionIfFileContainsNoProperties ( )
testAddEnginesFileThrowsExceptionIfFileDoesNotExist ( )
testAddPlatformsFileThrowsExceptionIfFileContainsInvalidJson ( ) tests if a specific exception is thrown in case of error while adding a platform json file
testAddPlatformsFileThrowsExceptionIfFileContainsNoData ( )
testAddPlatformsFileThrowsExceptionIfFileContainsNoMatch ( )
testAddPlatformsFileThrowsExceptionIfFileContainsNoProperties ( )
testAddPlatformsFileThrowsExceptionIfFileDoesNotExist ( )
testAddSourceFileOk ( ) checks if a source file is added successful
testAddSourceFileOkWithLiteAndVersions ( ) checks if a source file is added successful
testAddSourceFileThrowsExceptionIfChildrenAreNotArrays ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenDoesNotHaveMatchKeyword ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenHasDeviceProperties ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenHasEngineProperties ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenHasParentProperty ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenHasPlatformProperties ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenHaveAnInvalidMatchKeyword ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenIsNotAnArray ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenMatchKeywordHasPlatformPlaceHolderWithoutPlatforms ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenMatchKeywordHasVersionPlaceHolderWithoutVersions ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenPropertiesAreNotArrays ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfChildrenPropertyIsNotAnArray ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfDivisionIsAddedTwice ( ) checks if a exception is thrown if a division is defined twice in the source files
testAddSourceFileThrowsExceptionIfFileContainsInvalidJson ( ) checks if a exception is thrown if the source file had invalid json content
testAddSourceFileThrowsExceptionIfFileDoesNotExist ( )
testAddSourceFileThrowsExceptionIfNameHasInvalidCharsForUseragent ( ) checks if a exception is thrown if the lite property is missing
testAddSourceFileThrowsExceptionIfNoChildrenPropertyIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoCommentPropertyIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoDivisionIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoLitePropertyIsAvailable ( ) checks if a exception is thrown if the lite property is missing
testAddSourceFileThrowsExceptionIfNoNameIsAvailableForUseragent ( ) checks if a exception is thrown if the lite property is missing
testAddSourceFileThrowsExceptionIfNoParentPropertyIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoPropertiesAreAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoSortIndexIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoStandardPropertyIsAvailable ( ) checks if a exception is thrown if the lite property is missing
testAddSourceFileThrowsExceptionIfNoVersionsAreDefinedButVersionPropertyIsAvailable ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfNoVersionsAreDefinedWithVersionPlaceholders ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfParentPropertyIsNotDefaultProperties ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfPropertiesEntryIsNotAnArray ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfPropertiesIncludeDeviceData ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfPropertiesIncludeEngineData ( ) checks if a exception is thrown if the sortindex property is missing
testAddSourceFileThrowsExceptionIfPropertiesIncludePlatformData ( ) checks if a exception is thrown if the sortindex property is missing
testCheckPropertyOk ( ) tests if no error is raised if all went well
testCheckPropertyWithoutDeviceType ( )
testCheckPropertyWithoutIsMobileDevice ( )
testCheckPropertyWithoutIsTablet ( )
testCheckPropertyWithoutParent ( )
testCheckPropertyWithoutVersion ( )
testGetDeviceThrowsExceptionIfDeviceDoesNotExist ( )
testGetEngine ( ) tests getting an existing engine
testGetEngineThrowsExceptionIfEngineDoesNotExist ( )
testGetEngineThrowsExceptionIfPlatformDoesNotExist ( )
testGetGenerationDate ( ) tests getting the generation date
testGetPlatform ( ) tests getting an exiting platform
testGetPlatformThrowsExceptionIfPlatformDoesNotExist ( )
testGetVersion ( ) tests getting the version
testSetGetLogger ( ) tests the setter and the getter for a logger

Private Methods

Method Description
getDevicesJsonFixture ( )
getEngineJsonFixture ( )
getPlatformsJsonFixture ( )
getUserAgentFixtures ( )

Method Details

setUp() public method

This method is called before a test is executed.
public setUp ( )

testAddDefaultBrowser() public method

checks if the default browser is added sucessfully

testAddDefaultProperties() public method

checks if the default properties are added sucessfully

testAddEnginesFileThrowsExceptionIfFileContainsInvalidJson() public method

tests if a specific exception is thrown in case of error while adding an engine json file

testAddEnginesFileThrowsExceptionIfFileContainsNoData() public method

testAddEnginesFileThrowsExceptionIfFileContainsNoProperties() public method

testAddEnginesFileThrowsExceptionIfFileDoesNotExist() public method

testAddPlatformsFileThrowsExceptionIfFileContainsInvalidJson() public method

tests if a specific exception is thrown in case of error while adding a platform json file

testAddPlatformsFileThrowsExceptionIfFileContainsNoData() public method

testAddPlatformsFileThrowsExceptionIfFileContainsNoMatch() public method

testAddPlatformsFileThrowsExceptionIfFileContainsNoProperties() public method

testAddPlatformsFileThrowsExceptionIfFileDoesNotExist() public method

testAddSourceFileOk() public method

checks if a source file is added successful
public testAddSourceFileOk ( )

testAddSourceFileOkWithLiteAndVersions() public method

checks if a source file is added successful

testAddSourceFileThrowsExceptionIfChildrenAreNotArrays() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenDoesNotHaveMatchKeyword() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenHasDeviceProperties() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenHasEngineProperties() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenHasParentProperty() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenHasPlatformProperties() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenHaveAnInvalidMatchKeyword() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenIsNotAnArray() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenMatchKeywordHasPlatformPlaceHolderWithoutPlatforms() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenMatchKeywordHasVersionPlaceHolderWithoutVersions() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenPropertiesAreNotArrays() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfChildrenPropertyIsNotAnArray() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfDivisionIsAddedTwice() public method

checks if a exception is thrown if a division is defined twice in the source files

testAddSourceFileThrowsExceptionIfFileContainsInvalidJson() public method

checks if a exception is thrown if the source file had invalid json content

testAddSourceFileThrowsExceptionIfFileDoesNotExist() public method

testAddSourceFileThrowsExceptionIfNameHasInvalidCharsForUseragent() public method

checks if a exception is thrown if the lite property is missing

testAddSourceFileThrowsExceptionIfNoChildrenPropertyIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoCommentPropertyIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoDivisionIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoLitePropertyIsAvailable() public method

checks if a exception is thrown if the lite property is missing

testAddSourceFileThrowsExceptionIfNoNameIsAvailableForUseragent() public method

checks if a exception is thrown if the lite property is missing

testAddSourceFileThrowsExceptionIfNoParentPropertyIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoPropertiesAreAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoSortIndexIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoStandardPropertyIsAvailable() public method

checks if a exception is thrown if the lite property is missing

testAddSourceFileThrowsExceptionIfNoVersionsAreDefinedButVersionPropertyIsAvailable() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfNoVersionsAreDefinedWithVersionPlaceholders() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfParentPropertyIsNotDefaultProperties() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfPropertiesEntryIsNotAnArray() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfPropertiesIncludeDeviceData() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfPropertiesIncludeEngineData() public method

checks if a exception is thrown if the sortindex property is missing

testAddSourceFileThrowsExceptionIfPropertiesIncludePlatformData() public method

checks if a exception is thrown if the sortindex property is missing

testCheckPropertyOk() public method

tests if no error is raised if all went well
public testCheckPropertyOk ( )

testCheckPropertyWithoutDeviceType() public method

testCheckPropertyWithoutIsMobileDevice() public method

testCheckPropertyWithoutIsTablet() public method

testCheckPropertyWithoutParent() public method

testCheckPropertyWithoutVersion() public method

testGetDeviceThrowsExceptionIfDeviceDoesNotExist() public method

testGetEngine() public method

tests getting an existing engine
public testGetEngine ( )

testGetEngineThrowsExceptionIfEngineDoesNotExist() public method

testGetEngineThrowsExceptionIfPlatformDoesNotExist() public method

testGetGenerationDate() public method

tests getting the generation date

testGetPlatform() public method

tests getting an exiting platform
public testGetPlatform ( )

testGetPlatformThrowsExceptionIfPlatformDoesNotExist() public method

testGetVersion() public method

tests getting the version
public testGetVersion ( )

testSetGetLogger() public method

tests the setter and the getter for a logger
public testSetGetLogger ( )