\CodeBankAPITest
Synopsis
class CodeBankAPITest
extends SapphireTest
{
- // members
- public static string $fixture_file = 'SnippetTest.yml';
- // methods
- public void setUp()
- public void testAPIEndpoint()
- public void testLogin()
- public void testLogout()
- public void testAPIAccess()
- public void testMemberSavePreferences()
- public void testAdminPermissionFailure()
- public void testAdminDeleteUser()
- public void testChangePassword()
- public void testCreateUser()
- public void testCreateLanguage()
- public void testDeleteLanguage()
- public void testEditLanguage()
- public void testNewSnippet()
- public void testSaveSnippet()
- public void testDeleteSnippet()
- public void testRemoveSnippetFromPackage()
- public void testAddSnippetToPackage()
- public void testCreatePackage()
- public void testSavingPackage()
- public void testDeletePackage()
- public void testCreatingFolder()
- public void testRenameFolder()
- public void testDeleteFolder()
- public void testMoveSnippet()
- public void testSnippetSearch()
- protected {stdObject} arrayToObject()
- protected {array} getAMFResponse()
Hierarchy
Extends
- SapphireTest
Members
public
- $fixture_file
Methods
protected
- arrayToObject() — Generates a fake request object to be passed to the api class
- getAMFResponse() — Handles passing a request through the amf client
public
- setUp() — Forces the snippet languages to be populated on setup
- testAPIAccess() — Tests generic api access to see if user control is enforced correctly
- testAPIEndpoint() — Tests the api end point to ensure it is active and returning the correct response for a ping
- testAddSnippetToPackage() — Tests adding a snippet to a package
- testAdminDeleteUser() — Tests to see if admin's can delete a user, also checks to see that a normal user cannot
- testAdminPermissionFailure() — Checks to see if a non-admin user can access admin specific sections
- testChangePassword() — Test the change password system, first checks to ensure that a user changing their password must provide the current password, then checks to see if an admin can change another user's password
- testCreateLanguage() — Tests to see if the language creation is working correctly
- testCreatePackage() — Tests creating a package
- testCreateUser() — Tests to see if an admin can create a user, also checks to see if duplicate detection is functioning correctly
- testCreatingFolder() — Tests creating a folder, as well as checks to see that the duplicate detection is working and that detection for different languages is also working
- testDeleteFolder() — Tests to see that if a folder is deleted the decendent folders are moved up to the language and that the snippets are also removed correctly
- testDeleteLanguage() — Tests to see if the language deletion is working correctly
- testDeletePackage() — Tests deleting a package
- testDeleteSnippet() — Tests deleting a snippet through the api
- testEditLanguage() — Tests to see if the language editing is working correctly
- testLogin() — Tests to see if the login method in the session manager actually login a user
- testLogout() — Test to see if the logout method in the session manager actually logs the user out
- testMemberSavePreferences() — Tests to see if a member can update their preferences
- testMoveSnippet() — Tests moving a snippet to a folder, then to one in another language
- testNewSnippet() — Tests creating a snippet from the api
- testRemoveSnippetFromPackage() — Tests removing a snippet from a package
- testRenameFolder() — Tests renaming a folder, also tests to ensure that the duplicate checking is working
- testSaveSnippet() — Tests saving a snippet through the api
- testSavingPackage() — Tests saving a package
- testSnippetSearch() — Tests to see is snippet search is working as expected