Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,6 @@ $subscription = $github->activity->watching->setSubscription(':owner', ':repo',

// Delete a Repository Subscription.
$github->activity->watching->deleteSubscription(':owner', ':repo');

// Check if you are watching a repository (LEGACY).
// @return boolean True for a 204 response, False for a 404.
$github->activity->watching->check(':owner', ':repo');

// Watch a repository (LEGACY).
$github->activity->watching->watch(':owner', ':repo');

// Stop watching a repository (LEGACY).
$github->activity->watching->unwatch(':owner', ':repo');
```

### Gists
Expand Down Expand Up @@ -629,44 +619,11 @@ See http://developer.github.com/v3/orgs/teams/.
// List teams
$teams = $github->orgs->teams->getList(':org');

// Get team
$team = $github->orgs->teams->get(':teamId');

// Create team
$repos = array(':repoName');
$permission = 'pull|push|admin';
$github->orgs->teams->create(':org', ':name', $repos, $permission);

// Edit team
$github->orgs->teams->edit(':teamId', ':name', $permission);

// Delete team
$github->orgs->teams->delete(':teamId');

// List team members
$members = $github->orgs->teams->getListMembers(':teamId');

// Get team member
$isUserMember = $github->orgs->teams->isMember(':teamId', ':user');

// Add team member
$github->orgs->teams->addMember(':teamId', ':user');

// Remove team member
$github->orgs->teams->removeMember(':teamId', ':user');

// List team repos
$repos = $github->orgs->teams->getListRepos(':teamId');

// Get team repo
$isRepoManagedByTeam = $github->orgs->teams->checkRepo(':teamId', ':repo');

// Add team repo
$github->orgs->teams->addRepo(':teamId', ':org', ':repo');

// Remove team repo
$github->orgs->teams->removeRepo(':teamId', ':owner', ':repo');

// List user teams - TODO
```

Expand Down
103 changes: 0 additions & 103 deletions Tests/Package/Activity/WatchingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,107 +159,4 @@ public function testDeleteSubscription()
$this->object->deleteSubscription('joomla', 'joomla-platform')
);
}

/**
* Tests the check method
*
* @return void
*/
public function testCheck()
{
$this->response = $this->getResponseObject('', 204);

$this->client->expects($this->once())
->method('get')
->with('/user/subscriptions/joomla/joomla-platform', [], 0)
->willReturn($this->response);

$this->assertThat(
$this->object->check('joomla', 'joomla-platform'),
$this->equalTo(true)
);
}

/**
* Tests the checkFalse method
*
* @return void
*/
public function testCheckFalse()
{
$this->response = $this->getResponseObject('', 404);

$this->client->expects($this->once())
->method('get')
->with('/user/subscriptions/joomla/joomla-platform', [], 0)
->willReturn($this->response);

$this->assertThat(
$this->object->check('joomla', 'joomla-platform'),
$this->equalTo(false)
);
}

/**
* Tests the checkUnexpected method
*
* @return void
*/
public function testCheckUnexpected()
{
$this->expectException(\Laminas\Diactoros\Exception\InvalidArgumentException::class);

$this->response = $this->getResponseObject(false, 666);

$this->client->expects($this->once())
->method('get')
->with('/user/subscriptions/joomla/joomla-platform', [], 0)
->willReturn($this->response);

$this->object->check('joomla', 'joomla-platform');
}

/**
* Tests the watch method
*
* @return void
*/
public function testWatch()
{
$this->response = $this->getResponseObject('', 204);

$this->client->expects($this->once())
->method('put')
->with('/user/subscriptions/joomla/joomla-platform', '', [], 0)
->willReturn($this->response);

$response = (string) $this->response->getBody();

$this->assertEquals(
$response,
$this->object->watch('joomla', 'joomla-platform')
);
}

/**
* Tests the unwatch method
*
* @return void
*/
public function testUnwatch()
{
$this->response = $this->getResponseObject('', 204);

$this->client->expects($this->once())
->method('delete')
->with('/user/subscriptions/joomla/joomla-platform', [], 0)
->willReturn($this->response);

$response = (string) $this->response->getBody();

$this->assertEquals(
$response,
$this->object->unwatch('joomla', 'joomla-platform')
);
}
}
Loading
Loading