-
Notifications
You must be signed in to change notification settings - Fork 126
File permission option for file consumer #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,11 +50,30 @@ function testProductionProblems() { | |
| $this->assertFalse($tracked); | ||
| } | ||
|
|
||
| function testFileSecurity() { | ||
| $client = new Analytics_Client("testsecret", | ||
| array("consumer" => "file", | ||
| "filename" => $this->filename, | ||
| "filepermissions" => 0700 )); | ||
|
|
||
| $tracked = $client->track("some_user", "File PHP Event"); | ||
| $this->assertEquals(0700, (fileperms($this->filename) & 0777)); | ||
| } | ||
|
|
||
| function testFileSecurityDefaults() { | ||
| $client = new Analytics_Client("testsecret", | ||
| array("consumer" => "file", | ||
| "filename" => $this->filename )); | ||
|
|
||
| $tracked = $client->track("some_user", "File PHP Event"); | ||
| $this->assertEquals(0777, (fileperms($this->filename) & 0777)); | ||
| } | ||
|
|
||
| function checkWritten() { | ||
| exec("wc -l " . $this->filename, $output); | ||
| $this->assertEquals($output[0], "1 " . $this->filename); | ||
| $this->assertEquals(trim($output[0]), "1 " . $this->filename); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had some trouble making the tests pass without trimming this first. I believe this should affect anything else, and might actually make the test suite slightly more portable. But let me know if you don't like it and I can remove it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems ok to me. What was the failure without this? |
||
| unlink($this->filename); | ||
| } | ||
|
|
||
| } | ||
| ?> | ||
| ?> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this to
testFileSecurityCustom?