Skip to content

Commit

Permalink
Fixing dependencies to make tools buildable and testable (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec authored Nov 25, 2024
1 parent 2fb8810 commit d45dc2a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/FastyBird/Core/Tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"contributte/monolog": "^0.5",
"doctrine/orm": "2.15.*",
"doctrine/persistence": "^2.5 || ^3.4",
"ipub/doctrine-timestampable": "^v2.0",
"fastybird/datetime-factory": "^0.7.1",
"fastybird/metadata-library": "dev-main",
"mathsolver/mathsolver": "@dev",
Expand Down
3 changes: 3 additions & 0 deletions src/FastyBird/Core/Tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@
"eslint-config-prettier": "^9.1",
"eslint-plugin-prettier": "^5.2",
"eslint-plugin-vue": "^9.31",
"pinia": "^2.2",
"prettier": "^3.3",
"rimraf": "^6.0",
"rollup-plugin-delete": "^2.1",
"typescript": "5.6.2",
"vite": "^5.4",
"vite-plugin-dts": "^4.3",
"vue": "^3.5",
"vue-i18n": "^10.0",
"vue-loader": "^17.4",
"vue-router": "^4.4",
"vue-tsc": "^2.1"
},
"engines": {
Expand Down
3 changes: 1 addition & 2 deletions src/FastyBird/Core/Tools/src/DI/ToolsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

namespace FastyBird\Core\Tools\DI;

use FastyBird\Core\Application\Boot as ApplicationBoot;
use FastyBird\Core\Tools\Helpers;
use FastyBird\Core\Tools\Schemas;
use FastyBird\Core\Tools\Utilities;
Expand Down Expand Up @@ -46,7 +45,7 @@ class ToolsExtension extends DI\CompilerExtension
public const NAME = 'fbTools';

public static function register(
ApplicationBoot\Configurator $config,
Bootstrap\Configurator $config,
string $extensionName = self::NAME,
): void
{
Expand Down
13 changes: 1 addition & 12 deletions src/FastyBird/Core/Tools/tests/cases/unit/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace FastyBird\Core\Tools\Tests\Cases\Unit;

use Error;
use FastyBird\Core\Application\Boot as ApplicationBoot;
use FastyBird\Core\Application\Exceptions as ApplicationExceptions;
use FastyBird\Core\Tools\DI;
use Nette;
use PHPUnit\Framework\TestCase;
Expand All @@ -24,8 +22,6 @@ abstract class BaseTestCase extends TestCase
protected array $neonFiles = [];

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws Error
*/
protected function mockContainerService(
Expand All @@ -42,8 +38,6 @@ protected function mockContainerService(
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws Error
*/
protected function getContainer(): Nette\DI\Container
Expand All @@ -56,17 +50,14 @@ protected function getContainer(): Nette\DI\Container
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws Error
*/
private function createContainer(): Nette\DI\Container
{
$rootDir = __DIR__ . '/../..';
$vendorDir = defined('FB_VENDOR_DIR') ? constant('FB_VENDOR_DIR') : $rootDir . '/../vendor';

$config = ApplicationBoot\Bootstrap::boot();
$config->setForceReloadContainer();
$config = new Nette\Bootstrap\Configurator();
$config->setTempDirectory(FB_TEMP_DIR);

$config->addStaticParameters(
Expand All @@ -90,8 +81,6 @@ private function createContainer(): Nette\DI\Container
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws Error
*/
private function replaceContainerService(string $serviceName, object $service): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace FastyBird\Core\Tools\Tests\Cases\Unit\DI;

use Error;
use FastyBird\Core\Application\Exceptions as ApplicationExceptions;
use FastyBird\Core\Tools\Helpers;
use FastyBird\Core\Tools\Schemas;
use FastyBird\Core\Tools\Tests;
Expand All @@ -13,8 +12,6 @@ final class ToolsExtensionTest extends Tests\Cases\Unit\BaseTestCase
{

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws Error
* @throws Nette\DI\MissingServiceException
*/
Expand Down
5 changes: 2 additions & 3 deletions src/FastyBird/Core/Tools/tests/common.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
php:
date.timezone: Europe/Prague

fbApplication:
documents:
mapping: []
extensions:
fbDateTimeFactory : FastyBird\DateTimeFactory\DI\DateTimeFactoryExtension

0 comments on commit d45dc2a

Please sign in to comment.