Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
#46 - blt bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak committed Apr 6, 2022
1 parent 0c469be commit 446e392
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 41 deletions.
2 changes: 1 addition & 1 deletion behat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default:
extensions:
Blumilk\Meetup\Core\Testing\Behat:
Blumilk\Meetup\Core\Testing\BehatExtension:
env: ".env.behat"

suites:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require-dev": {
"blumilksoftware/blt": "dev-main",
"blumilksoftware/codestyle": "^1.0.0",
"blumilksoftware/codestyle": "^1.0.1",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
Expand Down Expand Up @@ -50,6 +50,7 @@
"scripts": {
"cs": "./vendor/bin/php-cs-fixer fix --dry-run --diff --config codestyle.php",
"csf": "./vendor/bin/php-cs-fixer fix --diff --config codestyle.php",
"behat": "./vendor/bin/behat",
"test": "phpunit",
"phpstan": [
"php -d memory_limit=600M vendor/bin/phpstan analyse -l 5 -c phpstan.neon"
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
],
"aliases" => [
...Facade::defaultAliases()->toArray(),
"Formats" => Blumilk\Meetup\Core\Formats::class,
"Formats" => Blumilk\Meetup\Core\Models\Utils\Formats::class,
"Auth" => Illuminate\Support\Facades\Auth::class,
],
];
2 changes: 1 addition & 1 deletion src/Models/Meetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Blumilk\Meetup\Core\Models;

use Blumilk\Meetup\Core\Formats;
use Blumilk\Meetup\Core\Models\Utils\Formats;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Blumilk\Meetup\Core\Models;

use Blumilk\Meetup\Core\Formats;
use Blumilk\Meetup\Core\Models\Utils\Formats;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Speaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Blumilk\Meetup\Core\Models;

use Blumilk\Meetup\Core\Formats;
use Blumilk\Meetup\Core\Models\Utils\Formats;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;

Expand Down
2 changes: 1 addition & 1 deletion src/Formats.php → src/Models/Utils/Formats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Blumilk\Meetup\Core;
namespace Blumilk\Meetup\Core\Models\Utils;

class Formats
{
Expand Down
19 changes: 0 additions & 19 deletions src/Testing/Behat.php

This file was deleted.

16 changes: 16 additions & 0 deletions src/Testing/BehatExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Meetup\Core\Testing;

use Blumilk\BLT\Bootstrapping\BootstrapperContract;
use Blumilk\BLT\Extensions\LaravelApplicationBehatExtension;

class BehatExtension extends LaravelApplicationBehatExtension
{
protected function provideBootstrapper(): BootstrapperContract
{
return new Bootstrapper();
}
}
17 changes: 2 additions & 15 deletions src/Testing/Bootstrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@
namespace Blumilk\Meetup\Core\Testing;

use Blumilk\BLT\Bootstrapping\LaravelBootstrapper;
use Blumilk\BLT\LaravelContracts;
use Blumilk\Meetup\Core\MeetupApplication;

class Bootstrapper extends LaravelBootstrapper
{
public function boot(): void
protected function getApplication()
{
$meetup = new MeetupApplication(__DIR__ . "/../../", ".env.behat");

$app = $meetup->getApplication();
$app->loadEnvironmentFrom($this->environmentFile);

if (!empty($this->configOverrides)) {
$app->afterBootstrapping(LaravelContracts::LOAD_CONFIGURATION_CLASS, function ($app): void {
$app["env"] = $this->environmentType;
foreach ($this->configOverrides as $key => $value) {
$app->make("config")->set($key, $value);
}
});
}

$app->make($this->getContractToBootstrap())->bootstrap();
return $meetup->getApplication();
}
}

0 comments on commit 446e392

Please sign in to comment.