Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
1.0.0
-----

* #113 Make Installation namespace conistent (prefix all with only `Installation`)
* Add pull request template
* #111 Move `Application` related VO's to separate namespace (DevboardLib\GitHub\Installation\ApplicationId -> DevboardLib\GitHub\Application\ApplicationId)
* #110 Moving from `Devboard` to `DevboardLib` namespace
Expand Down
70 changes: 35 additions & 35 deletions spec/GitHubInstallationSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@
namespace spec\DevboardLib\GitHub;

use DevboardLib\GitHub\Application\ApplicationId;
use DevboardLib\GitHub\GitHubInstallation;
use DevboardLib\GitHub\Installation\CreatedAt;
use DevboardLib\GitHub\Installation\Events;
use DevboardLib\GitHub\Installation\GitHubInstallationAccessTokenUrl;
use DevboardLib\GitHub\Installation\GitHubInstallationAccount;
use DevboardLib\GitHub\Installation\GitHubInstallationHtmlUrl;
use DevboardLib\GitHub\Installation\GitHubInstallationId;
use DevboardLib\GitHub\Installation\GitHubInstallationRepositoriesUrl;
use DevboardLib\GitHub\Installation\Permissions;
use DevboardLib\GitHub\Installation\RepositorySelection;
use DevboardLib\GitHub\Installation\UpdatedAt;
use DevboardLib\GitHub\Installation;
use DevboardLib\GitHub\Installation\InstallationAccessTokenUrl;
use DevboardLib\GitHub\Installation\InstallationAccount;
use DevboardLib\GitHub\Installation\InstallationCreatedAt;
use DevboardLib\GitHub\Installation\InstallationEvents;
use DevboardLib\GitHub\Installation\InstallationHtmlUrl;
use DevboardLib\GitHub\Installation\InstallationId;
use DevboardLib\GitHub\Installation\InstallationPermissions;
use DevboardLib\GitHub\Installation\InstallationRepositoriesUrl;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection;
use DevboardLib\GitHub\Installation\InstallationUpdatedAt;
use PhpSpec\ObjectBehavior;

class GitHubInstallationSpec extends ObjectBehavior
class InstallationSpec extends ObjectBehavior
{
public function let(
GitHubInstallationId $installationId,
GitHubInstallationAccount $installationAccount,
InstallationId $installationId,
InstallationAccount $installationAccount,
ApplicationId $applicationId,
RepositorySelection $repositorySelection,
Permissions $permissions,
Events $events,
GitHubInstallationAccessTokenUrl $accessTokenUrl,
GitHubInstallationRepositoriesUrl $repositoriesUrl,
GitHubInstallationHtmlUrl $htmlUrl,
CreatedAt $createdAt,
UpdatedAt $updatedAt
InstallationRepositorySelection $InstallationRepositorySelection,
InstallationPermissions $permissions,
InstallationEvents $events,
InstallationAccessTokenUrl $accessTokenUrl,
InstallationRepositoriesUrl $repositoriesUrl,
InstallationHtmlUrl $htmlUrl,
InstallationCreatedAt $createdAt,
InstallationUpdatedAt $updatedAt
) {
$this->beConstructedWith(
$installationId,
$installationAccount,
$applicationId,
$repositorySelection,
$InstallationRepositorySelection,
$permissions,
$events,
$accessTokenUrl,
Expand All @@ -50,26 +50,26 @@ public function let(

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallation::class);
$this->shouldHaveType(Installation::class);
}

public function it_should_expose_all_values_via_getters(
GitHubInstallationId $installationId,
GitHubInstallationAccount $installationAccount,
InstallationId $installationId,
InstallationAccount $installationAccount,
ApplicationId $applicationId,
RepositorySelection $repositorySelection,
Permissions $permissions,
Events $events,
GitHubInstallationAccessTokenUrl $accessTokenUrl,
GitHubInstallationRepositoriesUrl $repositoriesUrl,
GitHubInstallationHtmlUrl $htmlUrl,
CreatedAt $createdAt,
UpdatedAt $updatedAt
InstallationRepositorySelection $InstallationRepositorySelection,
InstallationPermissions $permissions,
InstallationEvents $events,
InstallationAccessTokenUrl $accessTokenUrl,
InstallationRepositoriesUrl $repositoriesUrl,
InstallationHtmlUrl $htmlUrl,
InstallationCreatedAt $createdAt,
InstallationUpdatedAt $updatedAt
) {
$this->getInstallationId()->shouldReturn($installationId);
$this->getInstallationAccount()->shouldReturn($installationAccount);
$this->getApplicationId()->shouldReturn($applicationId);
$this->getRepositorySelection()->shouldReturn($repositorySelection);
$this->getInstallationRepositorySelection()->shouldReturn($InstallationRepositorySelection);
$this->getPermissions()->shouldReturn($permissions);
$this->getEvents()->shouldReturn($events);
$this->getAccessTokenUrl()->shouldReturn($accessTokenUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\GitHubInstallationAccessTokenUrl;
use DevboardLib\GitHub\Installation\InstallationAccessTokenUrl;
use PhpSpec\ObjectBehavior;

class GitHubInstallationAccessTokenUrlSpec extends ObjectBehavior
class InstallationAccessTokenUrlSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -16,7 +16,7 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationAccessTokenUrl::class);
$this->shouldHaveType(InstallationAccessTokenUrl::class);
}

public function it_should_expose_value()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use DevboardLib\GitHub\Account\GitHubAccountId;
use DevboardLib\GitHub\Account\GitHubAccountLogin;
use DevboardLib\GitHub\Account\GitHubAccountType;
use DevboardLib\GitHub\Installation\GitHubInstallationAccount;
use DevboardLib\GitHub\Installation\InstallationAccount;
use PhpSpec\ObjectBehavior;

class GitHubInstallationAccountSpec extends ObjectBehavior
class InstallationAccountSpec extends ObjectBehavior
{
public function let(
GitHubAccountId $userId,
Expand All @@ -39,7 +39,7 @@ public function let(

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationAccount::class);
$this->shouldHaveType(InstallationAccount::class);
}

public function it_should_expose_all_values_via_getters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
namespace spec\DevboardLib\GitHub\Installation;

use DateTime;
use DevboardLib\GitHub\Installation\CreatedAt;
use DevboardLib\GitHub\Installation\InstallationCreatedAt;
use PhpSpec\ObjectBehavior;

class CreatedAtSpec extends ObjectBehavior
class InstallationCreatedAtSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -17,7 +17,7 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(CreatedAt::class);
$this->shouldHaveType(InstallationCreatedAt::class);
}

public function it_should_be_castable_to_string()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\Events;
use DevboardLib\GitHub\Installation\InstallationEvents;
use PhpSpec\ObjectBehavior;

class EventsSpec extends ObjectBehavior
class InstallationEventsSpec extends ObjectBehavior
{
public function let()
{
Expand Down Expand Up @@ -41,6 +41,6 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(Events::class);
$this->shouldHaveType(InstallationEvents::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\GitHubInstallationHtmlUrl;
use DevboardLib\GitHub\Installation\InstallationHtmlUrl;
use PhpSpec\ObjectBehavior;

class GitHubInstallationHtmlUrlSpec extends ObjectBehavior
class InstallationHtmlUrlSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -16,7 +16,7 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationHtmlUrl::class);
$this->shouldHaveType(InstallationHtmlUrl::class);
}

public function it_should_expose_value()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\GitHubInstallationId;
use DevboardLib\GitHub\Installation\InstallationId;
use PhpSpec\ObjectBehavior;

class GitHubInstallationIdSpec extends ObjectBehavior
class InstallationIdSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -16,7 +16,7 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationId::class);
$this->shouldHaveType(InstallationId::class);
}

public function it_should_expose_value()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\Permissions;
use DevboardLib\GitHub\Installation\InstallationPermissions;
use PhpSpec\ObjectBehavior;

class PermissionsSpec extends ObjectBehavior
class InstallationPermissionsSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -25,6 +25,6 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(Permissions::class);
$this->shouldHaveType(InstallationPermissions::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\GitHubInstallationRepositoriesUrl;
use DevboardLib\GitHub\Installation\InstallationRepositoriesUrl;
use PhpSpec\ObjectBehavior;

class GitHubInstallationRepositoriesUrlSpec extends ObjectBehavior
class InstallationRepositoriesUrlSpec extends ObjectBehavior
{
public function let()
{
Expand All @@ -16,7 +16,7 @@ public function let()

public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationRepositoriesUrl::class);
$this->shouldHaveType(InstallationRepositoriesUrl::class);
}

public function it_should_expose_value()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

declare(strict_types=1);

namespace spec\DevboardLib\GitHub\Installation\RepositorySelection;
namespace spec\DevboardLib\GitHub\Installation\InstallationRepositorySelection;

use DevboardLib\GitHub\Installation\RepositorySelection;
use DevboardLib\GitHub\Installation\RepositorySelection\GitHubInstallationRepositoryAll;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection\InstallationRepositoryAll;
use PhpSpec\ObjectBehavior;

class GitHubInstallationRepositoryAllSpec extends ObjectBehavior
class InstallationRepositoryAllSpec extends ObjectBehavior
{
public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationRepositoryAll::class);
$this->shouldImplement(RepositorySelection::class);
$this->shouldHaveType(InstallationRepositoryAll::class);
$this->shouldImplement(InstallationRepositorySelection::class);
}

public function it_knows_it_allows_access_to_all_repos()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

declare(strict_types=1);

namespace spec\DevboardLib\GitHub\Installation\RepositorySelection;
namespace spec\DevboardLib\GitHub\Installation\InstallationRepositorySelection;

use DevboardLib\GitHub\Installation\RepositorySelection;
use DevboardLib\GitHub\Installation\RepositorySelection\GitHubInstallationRepositorySelected;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection\InstallationRepositorySelected;
use PhpSpec\ObjectBehavior;

class GitHubInstallationRepositorySelectedSpec extends ObjectBehavior
class InstallationRepositorySelectedSpec extends ObjectBehavior
{
public function it_is_initializable()
{
$this->shouldHaveType(GitHubInstallationRepositorySelected::class);
$this->shouldImplement(RepositorySelection::class);
$this->shouldHaveType(InstallationRepositorySelected::class);
$this->shouldImplement(InstallationRepositorySelection::class);
}

public function it_knows_it_allows_access_to_only_selected_repos()
Expand Down
41 changes: 41 additions & 0 deletions spec/Installation/InstallationRepositorySelectionFactorySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace spec\DevboardLib\GitHub\Installation;

use DevboardLib\GitHub\Installation\InstallationRepositorySelection\InstallationRepositoryAll;
use DevboardLib\GitHub\Installation\InstallationRepositorySelection\InstallationRepositorySelected;
use DevboardLib\GitHub\Installation\InstallationRepositorySelectionFactory;
use DevboardLib\GitHub\Installation\InstallationRepositorySelectionFactoryException;
use PhpSpec\ObjectBehavior;

class InstallationRepositorySelectionFactorySpec extends ObjectBehavior
{
public function let()
{
$this->beConstructedWith();
}

public function it_is_initializable()
{
$this->shouldHaveType(InstallationRepositorySelectionFactory::class);
}

public function it_will_return_selected()
{
$this->create(InstallationRepositorySelected::NAME)
->shouldReturnAnInstanceOf(InstallationRepositorySelected::class);
}

public function it_will_return_all()
{
$this->create(InstallationRepositoryAll::NAME)
->shouldReturnAnInstanceOf(InstallationRepositoryAll::class);
}

public function it_will_throw_exception_on_unknown_string()
{
$this->shouldThrow(InstallationRepositorySelectionFactoryException::class)->duringCreate('SomeRandomName');
}
}
Loading