File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed
test/Github/Tests/Integration Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ $activity = $client->api('current_user')->starring()->all();
3131```
3232Returns an array of starred repos.
3333
34+ ### Get list of private and public events for an authenticated user for all repos
35+
36+ ``` php
37+ $activity = $client->api('user')->events('ornicar');
38+ ```
39+ Returns an array of private and public events created for all repos related to the user.
40+
3441### Get repos that a authenticated user has starred with creation date
3542
3643Support for getting the star creation timestamp in the response, using the custom ` Accept: application/vnd.github.v3.star+json ` header.
@@ -100,4 +107,4 @@ $owner = "KnpLabs";
100107$repo = "php-github-api";
101108$activity = $client->api('current_user')->watchers()->unwatch($owner, $repo);
102109```
103- Throws an Exception in case of failure or NULL in case of success.
110+ Throws an Exception in case of failure or NULL in case of success.
Original file line number Diff line number Diff line change @@ -148,6 +148,17 @@ $users = $client->api('current_user')->starring()->all();
148148
149149Returns an array of starred repos.
150150
151+ ### Get the authenticated user activity
152+
153+ > Requires [ authentication] ( security.md ) .
154+
155+ ``` php
156+ $activity = $client->api('user')->events('ornicar');
157+ ```
158+
159+ Returns an array of private and public events created for all repos related to the user.
160+ > See [ more] ( activity.md ) .
161+
151162### Get the authenticated user emails
152163
153164> Requires [ authentication] ( security.md ) .
Original file line number Diff line number Diff line change @@ -138,4 +138,25 @@ public function shouldGetReposBeingStarred()
138138 $ this ->assertArrayHasKey ('git_url ' , $ repo );
139139 $ this ->assertArrayHasKey ('svn_url ' , $ repo );
140140 }
141+
142+ /**
143+ * @test
144+ */
145+ public function shouldGetEventsForAuthenticatedUserBeignWatched ()
146+ {
147+ $ username = 'l3l0 ' ;
148+
149+ $ events = $ this ->client ->api ('user ' )->events ($ username );
150+ $ event = array_pop ($ events );
151+
152+ $ this ->assertArrayHasKey ('id ' , $ event );
153+ $ this ->assertArrayHasKey ('type ' , $ event );
154+ $ this ->assertArrayHasKey ('actor ' , $ event );
155+ $ this ->assertArrayHasKey ('login ' , $ event ['actor ' ]);
156+ $ this ->assertArrayHasKey ('repo ' , $ event );
157+ $ this ->assertArrayHasKey ('name ' , $ event ['repo ' ]);
158+ $ this ->assertArrayHasKey ('payload ' , $ event );
159+ $ this ->assertArrayHasKey ('public ' , $ event );
160+ $ this ->assertArrayHasKey ('created_at ' , $ event );
161+ }
141162}
You can’t perform that action at this time.
0 commit comments