{"action":"created","comment":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments/114343025","pull_request_review_id":35801117,"id":114343025,"diff_hunk":"@@ -0,0 +1,255 @@\n+<?php\n+\n+namespace SimpleSAML\\Test\\Utils;\n+\n+use \\SimpleSAML_Configuration as Configuration;\n+use \\SimpleSAML\\Utils\\System;\n+\n+use \\org\\bovigo\\vfs\\vfsStream;\n+\n+/**\n+ * Tests for SimpleSAML\\Utils\\System.\n+ */\n+class SystemTest extends \\PHPUnit_Framework_TestCase\n+{\n+    const ROOTDIRNAME = 'testdir';\n+\n+    public function setUp()\n+    {\n+        $this->root = vfsStream::setup(\n+            self::ROOTDIRNAME,\n+            null,\n+            array(\n+                'tempdir' => array(),\n+            )\n+        );\n+        $this->root_directory = vfsStream::url(self::ROOTDIRNAME);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::getOS\n+     * @test\n+     */\n+    public function testGetOSBasic()\n+    {\n+        $res = System::getOS();\n+\n+        $this->assertInternalType(\"int\", $res);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::resolvePath\n+     * @test\n+     */\n+    public function testResolvePathRemoveTrailingSlashes()\n+    {\n+        $base = \"/base////\";\n+        $path = \"test\";\n+\n+        $res = System::resolvePath($path, $base);\n+        $expected = \"/base/test\";\n+\n+        $this->assertEquals($expected, $res);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::resolvePath\n+     * @test\n+     */\n+    public function testResolvePathPreferAbsolutePathToBase()\n+    {\n+        $base = \"/base/\";\n+        $path = \"/test\";\n+\n+        $res = System::resolvePath($path, $base);\n+        $expected = \"/test\";\n+\n+        $this->assertEquals($expected, $res);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::resolvePath\n+     * @test\n+     */\n+    public function testResolvePathCurDirPath()\n+    {\n+        $base = \"/base/\";\n+        $path = \"/test/.\";\n+\n+        $res = System::resolvePath($path, $base);\n+        $expected = \"/test\";\n+\n+        $this->assertEquals($expected, $res);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::resolvePath\n+     * @test\n+     */\n+    public function testResolvePathParentPath()\n+    {\n+        $base = \"/base/\";\n+        $path = \"/test/child/..\";\n+\n+        $res = System::resolvePath($path, $base);\n+        $expected = \"/test\";\n+\n+        $this->assertEquals($expected, $res);\n+    }\n+\n+    /**\n+     * @covers \\SimpleSAML\\Utils\\System::writeFile\n+     * @test\n+     */\n+    public function testWriteFileInvalidArguments()\n+    {\n+        $this->setExpectedException('\\InvalidArgumentException');\n+        System::writeFile(null, null, null);\n+    }\n+\n+    /**\n+     * @requires PHP 5.4.0","path":"tests/lib/SimpleSAML/Utils/SystemTest.php","position":111,"original_position":111,"commit_id":"7737e1a8397e8fb749757eeb64e9a0450e406e29","original_commit_id":"7737e1a8397e8fb749757eeb64e9a0450e406e29","user":{"login":"mschwager","id":1724818,"avatar_url":"https://avatars2.githubusercontent.com/u/1724818?v=3","gravatar_id":"","url":"https://api.github.com/users/mschwager","html_url":"https://github.com/mschwager","followers_url":"https://api.github.com/users/mschwager/followers","following_url":"https://api.github.com/users/mschwager/following{/other_user}","gists_url":"https://api.github.com/users/mschwager/gists{/gist_id}","starred_url":"https://api.github.com/users/mschwager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschwager/subscriptions","organizations_url":"https://api.github.com/users/mschwager/orgs","repos_url":"https://api.github.com/users/mschwager/repos","events_url":"https://api.github.com/users/mschwager/events{/privacy}","received_events_url":"https://api.github.com/users/mschwager/received_events","type":"User","site_admin":false},"body":"This is a limitation of `vfsstream`: https://github.com/mikey179/vfsStream/issues/56\r\n\r\n```\r\ntouch(), chown(), chgrp() and chmod() only work with PHP >= 5.4 because support of stream wrappers for those functions was first added with PHP 5.4, see issue #56. With PHP 5.3 an error with the message \"Unable to create file vfs://... because No such file or directory\" will be raised\r\n```\r\n\r\nOther than this, `vfsstream` is a nice library. I've used it for a number of projects and it's definitely helpful when mocking out the filesystem :)","created_at":"2017-05-02T15:14:13Z","updated_at":"2017-05-02T15:14:13Z","html_url":"https://github.com/simplesamlphp/simplesamlphp/pull/592#discussion_r114343025","pull_request_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592","_links":{"self":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments/114343025"},"html":{"href":"https://github.com/simplesamlphp/simplesamlphp/pull/592#discussion_r114343025"},"pull_request":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592"}}},"pull_request":{"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592","id":114252509,"html_url":"https://github.com/simplesamlphp/simplesamlphp/pull/592","diff_url":"https://github.com/simplesamlphp/simplesamlphp/pull/592.diff","patch_url":"https://github.com/simplesamlphp/simplesamlphp/pull/592.patch","issue_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/592","number":592,"state":"open","locked":false,"title":"Added tests for SimpleSAMLUtilsSystem","user":{"login":"mschwager","id":1724818,"avatar_url":"https://avatars2.githubusercontent.com/u/1724818?v=3","gravatar_id":"","url":"https://api.github.com/users/mschwager","html_url":"https://github.com/mschwager","followers_url":"https://api.github.com/users/mschwager/followers","following_url":"https://api.github.com/users/mschwager/following{/other_user}","gists_url":"https://api.github.com/users/mschwager/gists{/gist_id}","starred_url":"https://api.github.com/users/mschwager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschwager/subscriptions","organizations_url":"https://api.github.com/users/mschwager/orgs","repos_url":"https://api.github.com/users/mschwager/repos","events_url":"https://api.github.com/users/mschwager/events{/privacy}","received_events_url":"https://api.github.com/users/mschwager/received_events","type":"User","site_admin":false},"body":"Hey all,\r\n\r\nI noticed this file was missing tests so I wrote some :)","created_at":"2017-04-04T21:52:32Z","updated_at":"2017-05-02T15:14:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"253cdea12273b1c2f0f04e662704ba51d35b41f0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592/commits","review_comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592/comments","review_comment_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/592/comments","statuses_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/7737e1a8397e8fb749757eeb64e9a0450e406e29","head":{"label":"mschwager:master","ref":"master","sha":"7737e1a8397e8fb749757eeb64e9a0450e406e29","user":{"login":"mschwager","id":1724818,"avatar_url":"https://avatars2.githubusercontent.com/u/1724818?v=3","gravatar_id":"","url":"https://api.github.com/users/mschwager","html_url":"https://github.com/mschwager","followers_url":"https://api.github.com/users/mschwager/followers","following_url":"https://api.github.com/users/mschwager/following{/other_user}","gists_url":"https://api.github.com/users/mschwager/gists{/gist_id}","starred_url":"https://api.github.com/users/mschwager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschwager/subscriptions","organizations_url":"https://api.github.com/users/mschwager/orgs","repos_url":"https://api.github.com/users/mschwager/repos","events_url":"https://api.github.com/users/mschwager/events{/privacy}","received_events_url":"https://api.github.com/users/mschwager/received_events","type":"User","site_admin":false},"repo":{"id":35616064,"name":"simplesamlphp","full_name":"mschwager/simplesamlphp","owner":{"login":"mschwager","id":1724818,"avatar_url":"https://avatars2.githubusercontent.com/u/1724818?v=3","gravatar_id":"","url":"https://api.github.com/users/mschwager","html_url":"https://github.com/mschwager","followers_url":"https://api.github.com/users/mschwager/followers","following_url":"https://api.github.com/users/mschwager/following{/other_user}","gists_url":"https://api.github.com/users/mschwager/gists{/gist_id}","starred_url":"https://api.github.com/users/mschwager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschwager/subscriptions","organizations_url":"https://api.github.com/users/mschwager/orgs","repos_url":"https://api.github.com/users/mschwager/repos","events_url":"https://api.github.com/users/mschwager/events{/privacy}","received_events_url":"https://api.github.com/users/mschwager/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mschwager/simplesamlphp","description":"SimpleSAMLphp is an award-winning application written in native PHP that deals with authentication.","fork":true,"url":"https://api.github.com/repos/mschwager/simplesamlphp","forks_url":"https://api.github.com/repos/mschwager/simplesamlphp/forks","keys_url":"https://api.github.com/repos/mschwager/simplesamlphp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mschwager/simplesamlphp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mschwager/simplesamlphp/teams","hooks_url":"https://api.github.com/repos/mschwager/simplesamlphp/hooks","issue_events_url":"https://api.github.com/repos/mschwager/simplesamlphp/issues/events{/number}","events_url":"https://api.github.com/repos/mschwager/simplesamlphp/events","assignees_url":"https://api.github.com/repos/mschwager/simplesamlphp/assignees{/user}","branches_url":"https://api.github.com/repos/mschwager/simplesamlphp/branches{/branch}","tags_url":"https://api.github.com/repos/mschwager/simplesamlphp/tags","blobs_url":"https://api.github.com/repos/mschwager/simplesamlphp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mschwager/simplesamlphp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mschwager/simplesamlphp/git/refs{/sha}","trees_url":"https://api.github.com/repos/mschwager/simplesamlphp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mschwager/simplesamlphp/statuses/{sha}","languages_url":"https://api.github.com/repos/mschwager/simplesamlphp/languages","stargazers_url":"https://api.github.com/repos/mschwager/simplesamlphp/stargazers","contributors_url":"https://api.github.com/repos/mschwager/simplesamlphp/contributors","subscribers_url":"https://api.github.com/repos/mschwager/simplesamlphp/subscribers","subscription_url":"https://api.github.com/repos/mschwager/simplesamlphp/subscription","commits_url":"https://api.github.com/repos/mschwager/simplesamlphp/commits{/sha}","git_commits_url":"https://api.github.com/repos/mschwager/simplesamlphp/git/commits{/sha}","comments_url":"https://api.github.com/repos/mschwager/simplesamlphp/comments{/number}","issue_comment_url":"https://api.github.com/repos/mschwager/simplesamlphp/issues/comments{/number}","contents_url":"https://api.github.com/repos/mschwager/simplesamlphp/contents/{+path}","compare_url":"https://api.github.com/repos/mschwager/simplesamlphp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mschwager/simplesamlphp/merges","archive_url":"https://api.github.com/repos/mschwager/simplesamlphp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mschwager/simplesamlphp/downloads","issues_url":"https://api.github.com/repos/mschwager/simplesamlphp/issues{/number}","pulls_url":"https://api.github.com/repos/mschwager/simplesamlphp/pulls{/number}","milestones_url":"https://api.github.com/repos/mschwager/simplesamlphp/milestones{/number}","notifications_url":"https://api.github.com/repos/mschwager/simplesamlphp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mschwager/simplesamlphp/labels{/name}","releases_url":"https://api.github.com/repos/mschwager/simplesamlphp/releases{/id}","deployments_url":"https://api.github.com/repos/mschwager/simplesamlphp/deployments","created_at":"2015-05-14T14:33:36Z","updated_at":"2017-03-29T21:02:14Z","pushed_at":"2017-04-04T22:47:06Z","git_url":"git://github.com/mschwager/simplesamlphp.git","ssh_url":"git@github.com:mschwager/simplesamlphp.git","clone_url":"https://github.com/mschwager/simplesamlphp.git","svn_url":"https://github.com/mschwager/simplesamlphp","homepage":null,"size":14816,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"simplesamlphp:master","ref":"master","sha":"bcbddcdffe840a014b9ad322382a10336c04c127","user":{"login":"simplesamlphp","id":5774640,"avatar_url":"https://avatars0.githubusercontent.com/u/5774640?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesamlphp","html_url":"https://github.com/simplesamlphp","followers_url":"https://api.github.com/users/simplesamlphp/followers","following_url":"https://api.github.com/users/simplesamlphp/following{/other_user}","gists_url":"https://api.github.com/users/simplesamlphp/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesamlphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesamlphp/subscriptions","organizations_url":"https://api.github.com/users/simplesamlphp/orgs","repos_url":"https://api.github.com/users/simplesamlphp/repos","events_url":"https://api.github.com/users/simplesamlphp/events{/privacy}","received_events_url":"https://api.github.com/users/simplesamlphp/received_events","type":"Organization","site_admin":false},"repo":{"id":17167136,"name":"simplesamlphp","full_name":"simplesamlphp/simplesamlphp","owner":{"login":"simplesamlphp","id":5774640,"avatar_url":"https://avatars0.githubusercontent.com/u/5774640?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesamlphp","html_url":"https://github.com/simplesamlphp","followers_url":"https://api.github.com/users/simplesamlphp/followers","following_url":"https://api.github.com/users/simplesamlphp/following{/other_user}","gists_url":"https://api.github.com/users/simplesamlphp/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesamlphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesamlphp/subscriptions","organizations_url":"https://api.github.com/users/simplesamlphp/orgs","repos_url":"https://api.github.com/users/simplesamlphp/repos","events_url":"https://api.github.com/users/simplesamlphp/events{/privacy}","received_events_url":"https://api.github.com/users/simplesamlphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplesamlphp/simplesamlphp","description":"SimpleSAMLphp is an award-winning application written in native PHP that deals with authentication.","fork":false,"url":"https://api.github.com/repos/simplesamlphp/simplesamlphp","forks_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/forks","keys_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/teams","hooks_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/hooks","issue_events_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/events{/number}","events_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/events","assignees_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/assignees{/user}","branches_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/branches{/branch}","tags_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/tags","blobs_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/{sha}","languages_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/languages","stargazers_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/stargazers","contributors_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/contributors","subscribers_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/subscribers","subscription_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/subscription","commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/contents/{+path}","compare_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/merges","archive_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/downloads","issues_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues{/number}","pulls_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls{/number}","milestones_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/milestones{/number}","notifications_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/labels{/name}","releases_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/releases{/id}","deployments_url":"https://api.github.com/repos/simplesamlphp/simplesamlphp/deployments","created_at":"2014-02-25T09:01:45Z","updated_at":"2017-05-01T18:13:20Z","pushed_at":"2017-04-28T21:32:39Z","git_url":"git://github.com/simplesamlphp/simplesamlphp.git","ssh_url":"git@github.com:simplesamlphp/simplesamlphp.git","clone_url":"https://github.com/simplesamlphp/simplesamlphp.git","svn_url":"https://github.com/simplesamlphp/simplesamlphp","homepage":"https://simplesamlphp.org","size":15088,"stargazers_count":376,"watchers_count":376,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":297,"mirror_url":null,"open_issues_count":150,"forks":297,"open_issues":150,"watchers":376,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592"},"html":{"href":"https://github.com/simplesamlphp/simplesamlphp/pull/592"},"issue":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/592"},"comments":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/issues/592/comments"},"review_comments":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592/comments"},"review_comment":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/pulls/592/commits"},"statuses":{"href":"https://api.github.com/repos/simplesamlphp/simplesamlphp/statuses/7737e1a8397e8fb749757eeb64e9a0450e406e29"}}}}
{"actor":{"display_login":"mschwager"}}