\FileSecuredTest
Attempts to excercise all the customised canXX() methods on {@link FileSecured}.
- Author: Deviate Ltd 2014-2015 http://www.deviate.net.nz
Synopsis
class FileSecuredTest
extends FunctionalTest
{
- // members
- protected static string $fixture_file = 'fixtures/FileSecuredTest.yml';
- protected static string $test_folder = 'test-secured';
- // methods
- public void tearDown()
- public void testCanViewInCMSAsAdmin()
- public void testCanViewInCMSAsSecuredAssetAdmin()
- public void testCanViewInCMSAsStandardAssetAdmin()
- public void testCanViewStandardAssetsInCMSAsSecuredAssetAdmin()
- public void testCanViewStandardAssetsInCMSAsStandardAssetAdmin()
- public void testCanViewFrontNotLoggedIn()
- public void testCanViewFrontLoggedIn()
- public void testCanViewFrontByTime()
- public void testCanViewFrontByAnyone()
- public void testCanViewFrontByLoggedInUsers()
- private File createUnsecuredFile()
- private File createSecuredFile()
- private Folder createSecuredFolder()
Hierarchy
Extends
- FunctionalTest
Tasks
Line | Task |
---|---|
11+ | Why is a user with ADMIN always running tests? |
11+ | Complete commented assertions. Note: FolderSecured may need its own canView() definition |
Members
protected
- $fixture_file — string
- $test_folder — string
Methods
private
- createSecuredFile() — Utility method to create a {@link FileSecured} object and save to the test DB.
- createSecuredFolder() — Utility method to create a {@link FolderSecured} object and save to the test DB.
- createUnsecuredFile() — Utility method.
public
- tearDown() — Remove test dir(s) after test runs
- testCanViewFrontByAnyone()
- testCanViewFrontByLoggedInUsers() — Can users accessing the frontend, while logged-in, access what they should and shouldn't?
- testCanViewFrontByTime() — Simply tests the return status of FileSecured::canViewFrontByTime() which looks weird out of context.
- testCanViewFrontLoggedIn() — Users may well be logged into the CMS, but can I see file(s) in the front-end too? (and other stories)
- testCanViewFrontNotLoggedIn() — Users not logged-into the CMS, but can they see file(s) in the front-end too?
- testCanViewInCMSAsAdmin() — Can ADMIN CMS users, view individual SECURED files in the CMS?
- testCanViewInCMSAsSecuredAssetAdmin() — Can AdvancedAsset CMS users, view individual SECURED files in the CMS?
- testCanViewInCMSAsStandardAssetAdmin() — Can Standard CMS asset-admin users, view individual SECURED files in the CMS?
- testCanViewStandardAssetsInCMSAsSecuredAssetAdmin() — Can AdvancedAsset CMS users, also view individual UNSECURED files in the CMS?
- testCanViewStandardAssetsInCMSAsStandardAssetAdmin() — Can Standard Asset CMS users, also view individual UNSECURED files in the CMS? Essentially just replicates standard CMS tests for the same thing