PHP Class Prose\UsingUsers

Inheritance: extends Prose
显示文件 Open project: datasift/storyplayer

Public Methods

Method Description
loadUsersFromFile ( string $filename ) : DataSift\Stone\ObjectLib\BaseObject load test users from the given filename
saveUsersToFile ( DataSift\Stone\ObjectLib\BaseObject $users, string $filename ) : void save test users to disk
setUsersFileIsReadOnly ( ) tell Storyplayer that test users loaded via the --users switch must not be saved back to disk when the stories are over

Method Details

loadUsersFromFile() public method

NOTES: - Storyplayer calls this for you when you use the --users switch - it is safe to call this yourself from a story if you want to load additional users for any reason. however, Storyplayer will not manage saving these users for you - you WILL have to do that yourself
public loadUsersFromFile ( string $filename ) : DataSift\Stone\ObjectLib\BaseObject
$filename string the JSON file to load users from
return DataSift\Stone\ObjectLib\BaseObject

saveUsersToFile() public method

NOTES: - Storyplayer calls this for you when all tests have completed - if you've loaded test users yourself inside your test, you'll need to call this method to save those test users
public saveUsersToFile ( DataSift\Stone\ObjectLib\BaseObject $users, string $filename ) : void
$users DataSift\Stone\ObjectLib\BaseObject the test users to save to disk
$filename string the filename to save to
return void

setUsersFileIsReadOnly() public method

NOTES: - Storyplayer calls this for you if you use the --read-only-users switch, or put 'moduleSettings.users.readOnly' in your test environment config - this setting has no effect if you call saveUsersToFile() manually