-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into #56-add-notifications-tools
- Loading branch information
Showing
13 changed files
with
588 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Blumilk\BLT\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Symfony\Component\Process\Exception\ProcessFailedException; | ||
use Symfony\Component\Process\Process; | ||
|
||
class BLTInit extends Command | ||
{ | ||
protected $signature = "blt:init"; | ||
protected $description = "Initialize BLT in your project"; | ||
|
||
public function handle(): void | ||
{ | ||
$this->info("Configuring BLT package..."); | ||
|
||
if (!is_dir("features")) { | ||
$this->initializeBehat(); | ||
} | ||
|
||
if (!file_exists(".env.behat")) { | ||
$this->copyEnvFile(); | ||
} | ||
|
||
$this->info("Behat configured successfully with BLT"); | ||
} | ||
|
||
protected function initializeBehat(): void | ||
{ | ||
$process = new Process(["vendor/bin/behat", "--init"]); | ||
$process->run(); | ||
|
||
if (!$process->isSuccessful()) { | ||
throw new ProcessFailedException($process); | ||
} | ||
|
||
$this->info($process->getOutput()); | ||
} | ||
|
||
protected function copyEnvFile(): void | ||
{ | ||
if (!copy(".env.example", ".env.behat")) { | ||
$this->error("Failed to copy .env.example to .env.behat"); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Blumilk\BLT\Features; | ||
|
||
use Behat\Behat\Context\Context; | ||
use Blumilk\BLT\Features\Traits\HttpRequest as HttpRequestTrait; | ||
|
||
class HttpRequest implements Context | ||
{ | ||
use HttpRequestTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Blumilk\BLT\Features; | ||
|
||
use Behat\Behat\Context\Context; | ||
use Blumilk\BLT\Features\Traits\HttpResponse as HttpResponseTrait; | ||
|
||
class HttpResponse implements Context | ||
{ | ||
use HttpResponseTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.