Skip to content

Commit

Permalink
qa: use example.org for test domains
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
  • Loading branch information
weierophinney committed Nov 20, 2024
1 parent 21cddbd commit ab87917
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions test/Config/DiscoverPackageFromGitRemoteListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testReturnsEarlyIfProviderHasNoUrl()

public function testDoesNotNotifyEventOfAnythingIfNoRemotesFound()
{
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');
$this->config->expects($this->once())->method('provider')->willReturn($this->provider);
$this->event->expects($this->once())->method('packageWasFound')->willReturn(false);
$this->event->expects($this->once())->method('config')->willReturn($this->config);
Expand All @@ -72,7 +72,7 @@ public function testDoesNotNotifyEventOfAnythingIfNoRemotesFound()

public function testDoesNotNotifyEventOfAnythingIfNoRemoteUrlsFound()
{
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');
$this->config->expects($this->once())->method('provider')->willReturn($this->provider);
$this->event->expects($this->once())->method('packageWasFound')->willReturn(false);
$this->event->expects($this->once())->method('config')->willReturn($this->config);
Expand All @@ -93,7 +93,7 @@ public function testDoesNotNotifyEventOfAnythingIfNoRemoteUrlsFound()

public function testDoesNotNotifyEventOfAnythingIfNoMatchingRemotesFound()
{
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');
$this->config->expects($this->once())->method('provider')->willReturn($this->provider);
$this->event->expects($this->once())->method('packageWasFound')->willReturn(false);
$this->event->expects($this->once())->method('config')->willReturn($this->config);
Expand All @@ -118,7 +118,7 @@ public function testDoesNotNotifyEventOfAnythingIfNoMatchingRemotesFound()

public function testNotifiesEventOfFirstMatchingRemoteFound()
{
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');
$this->config->expects($this->once())->method('provider')->willReturn($this->provider);
$this->event->expects($this->once())->method('packageWasFound')->willReturn(false);
$this->event->expects($this->once())->method('config')->willReturn($this->config);
Expand All @@ -132,10 +132,10 @@ public function testNotifiesEventOfFirstMatchingRemoteFound()
return;
}
if (preg_match('/origin/', $command)) {
$output = ['me@git.mwop.net:some/package.git'];
$output = ['me@git.example.org:some/package.git'];
return;
}
$output = ['you@git.mwop.net:another/package.git'];
$output = ['you@git.example.org:another/package.git'];
};

$this->assertNull($listener($this->event));
Expand Down
24 changes: 12 additions & 12 deletions test/Config/DiscoverRemoteFromGitRemotesListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testReturnsEarlyIfConfigHasNoPackageAssociated()
$this->event->expects($this->never())->method('reportNoMatchingGitRemoteFound');
$this->event->expects($this->never())->method('foundRemote');
$this->event->expects($this->never())->method('setRemotes');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');

$listener = new DiscoverRemoteFromGitRemotesListener();

Expand All @@ -83,10 +83,10 @@ public function testReportsNoMatchingGitRemotesFoundIfCommandFails()
$this->event
->expects($this->once())
->method('reportNoMatchingGitRemoteFound')
->with('git.mwop.net', 'some/package');
->with('git.example.org', 'some/package');
$this->event->expects($this->never())->method('foundRemote');
$this->event->expects($this->never())->method('setRemotes');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');

$listener = new DiscoverRemoteFromGitRemotesListener();
$listener->exec = function (string $command, array &$output, int &$return) {
Expand All @@ -105,18 +105,18 @@ public function testReportsNoMatchingGitRemotesFoundIfNoRemotesMatchDomainAndPac
$this->event
->expects($this->once())
->method('reportNoMatchingGitRemoteFound')
->with('git.mwop.net', 'some/package');
->with('git.example.org', 'some/package');
$this->event->expects($this->never())->method('foundRemote');
$this->event->expects($this->never())->method('setRemotes');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');

$listener = new DiscoverRemoteFromGitRemotesListener();
$listener->exec = function (string $command, array &$output, int &$return) {
$output = [
'origin https://github.com/some/package.git (push)',
'upstream [email protected]:some/package.git (push)',
'myself git://git.mwop.net/another/package.git (push)',
'readonly git://git.mwop.net/some/package.git (pull)',
'myself git://git.example.org/another/package.git (push)',
'readonly git://git.example.org/some/package.git (pull)',
];
};

Expand All @@ -135,14 +135,14 @@ public function testReportsRemoteFoundIfExactlyOneRemoteMatches()
->with('myself');
$this->event->expects($this->never())->method('reportNoMatchingGitRemoteFound');
$this->event->expects($this->never())->method('setRemotes');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');

$listener = new DiscoverRemoteFromGitRemotesListener();
$listener->exec = function (string $command, array &$output, int &$return) {
$output = [
'origin https://github.com/some/package.git (push)',
'upstream [email protected]:some/package.git (push)',
'myself git://git.mwop.net/some/package.git (push)',
'myself git://git.example.org/some/package.git (push)',
];
};

Expand All @@ -161,14 +161,14 @@ public function testReportsMultipleRemotesFoundIfMoreThanOneRemoteMatches()
->with(['upstream', 'myself']);
$this->event->expects($this->never())->method('reportNoMatchingGitRemoteFound');
$this->event->expects($this->never())->method('foundRemote');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.mwop.net');
$this->provider->expects($this->once())->method('url')->willReturn('https://git.example.org');

$listener = new DiscoverRemoteFromGitRemotesListener();
$listener->exec = function (string $command, array &$output, int &$return) {
$output = [
'origin https://github.com/some/package.git (push)',
'upstream me@git.mwop.net:some/package.git (push)',
'myself git://git.mwop.net/some/package.git (push)',
'upstream me@git.example.org:some/package.git (push)',
'myself git://git.example.org/some/package.git (push)',
];
};

Expand Down
2 changes: 1 addition & 1 deletion test/Config/RetrieveGlobalConfigListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testPopulatesConfigFromFile()
$provider = $providers->get('github');
$this->assertInstanceOf(Provider\ProviderSpec::class, $provider);
$this->assertSame('github', $provider->name());
$this->assertSame('https://github.mwop.net', $this->getAttributeValue($provider, 'url'));
$this->assertSame('https://github.example.org', $this->getAttributeValue($provider, 'url'));
$this->assertSame('this-is-a-github-token', $this->getAttributeValue($provider, 'token'));
}
}
2 changes: 1 addition & 1 deletion test/Config/RetrieveInputOptionsListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function testCanPopulateProviderFromProviderOption()
->will($this->returnValueMap([
['provider', 'gitlab'],
['provider-token', 'this-is-the-token'],
['provider-url', 'https://git.mwop.net'],
['provider-url', 'https://git.example.org'],
['package', 'some/package'],
]));

Expand Down
2 changes: 1 addition & 1 deletion test/ConfigCommand/ShowMergedConfigListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testNotifiesEventToDisplayMergedConfig()
TestCase::assertSame('CHANGELOG.txt', $config['defaults']['changelog_file']);
TestCase::assertSame('github', $config['defaults']['provider']);
TestCase::assertSame('origin', $config['defaults']['remote']);
TestCase::assertSame('https://github.mwop.net', $config['providers']['github']['url']);
TestCase::assertSame('https://github.example.org', $config['providers']['github']['url']);
return true;
}));

Expand Down
2 changes: 1 addition & 1 deletion test/Entry/PrependIssueLinkListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function generateEmptyLinkRequested(ProviderInterface&MockObject $provide
*/
public function generateLinkRequested(ProviderInterface&MockObject $provider): void
{
$this->link = sprintf('[#%s](https://git.mwop.net/issue/%s)', $this->identifier, $this->identifier);
$this->link = sprintf('[#%s](https://git.example.org/issue/%s)', $this->identifier, $this->identifier);
$provider
->expects($this->atLeastOnce())
->method('generateIssueLink')
Expand Down
2 changes: 1 addition & 1 deletion test/Entry/PrependPatchLinkListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function generateEmptyLinkRequested(ProviderInterface&MockObject $provide
*/
public function generateLinkRequested(ProviderInterface&MockObject $provider): void
{
$this->link = sprintf('[#%s](https://git.mwop.net/issue/%s)', $this->identifier, $this->identifier);
$this->link = sprintf('[#%s](https://git.example.org/issue/%s)', $this->identifier, $this->identifier);
$provider
->expects($this->atLeastOnce())
->method('generatePatchLink')
Expand Down
4 changes: 2 additions & 2 deletions test/Provider/ProviderSpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public function testSetsUrlInCreatedProviderWhenPresentInSpec()
{
$spec = new ProviderSpec('test');
$spec->setClassName(Provider::class);
$spec->setUrl('https://mwop.net');
$spec->setUrl('https://example.org');

$provider = $spec->createProvider();

$this->assertInstanceOf(Provider::class, $provider);
$this->assertNull($provider->package);
$this->assertNull($provider->token);
$this->assertSame('https://mwop.net', $provider->url);
$this->assertSame('https://example.org', $provider->url);
}
}
2 changes: 1 addition & 1 deletion test/_files/config/keep-a-changelog.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ remote = upstream

[providers]
github[class] = Phly\KeepAChangelog\Provider\GitHub
github[url] = https://github.mwop.net
github[url] = https://github.example.org
github[token] = this-is-a-github-token
gitlab[class] = Phly\KeepAChangelog\Provider\GitLab
gitlab[token] = this-is-a-gitlab-token
2 changes: 1 addition & 1 deletion test/_files/config/local/.keep-a-changelog.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ remote = origin

[providers]
github[class] = Phly\KeepAChangelog\Provider\GitHub
github[url] = https://github.mwop.net
github[url] = https://github.example.org
gitlab[class] = Phly\KeepAChangelog\Provider\GitLab

0 comments on commit ab87917

Please sign in to comment.