Skip to content

Commit

Permalink
Implement sharing functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterSioen committed Jan 5, 2020
1 parent 9597770 commit 2d0f5e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/HtaccessCommand.php
Expand Up @@ -83,6 +83,21 @@ function (ResultLine $resultLine): array {
)
);

if ($input->getOption('share')) {
try {
$share = $this->htaccessClient->share(
$url,
$htaccess,
$input->getOption('referrer'),
$input->getOption('server-name')
);

$io->text('You can share this test run on ' . $share->getShareUrl());
} catch (HtaccessException $exception) {
// when sharing failed, just ignore it
}
}

if ($input->getOption('expected-url') && $result->getOutputUrl() !== $input->getOption('expected-url')) {
$io->error('The output url is "' . $result->getOutputUrl() . '", while we expected "' . $input->getOption('expected-url') . '"');

Expand Down

0 comments on commit 2d0f5e0

Please sign in to comment.