Skip to content

Commit

Permalink
NTR: fix fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed May 17, 2024
1 parent a169a72 commit b129b79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 3 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ prod: ## Installs all production dependencies
# also install shopware in here -> we just need it for the release composer.json file
# so just switch to our dev dependency variant
php switch-composer.php dev
# since we changed composer autoload, we need to refresh the plugin list so autoload section is updated in db
cd ../../.. && php bin/console --no-debug plugin:refresh
# ----------------------------------------------------------------
@composer validate
@composer install --no-dev
Expand All @@ -29,6 +31,7 @@ prod: ## Installs all production dependencies

dev: ## Installs all dev dependencies
php switch-composer.php dev
cd ../../.. && php bin/console --no-debug plugin:refresh
@composer validate
# we have to run update in dev mode, because dev dependencies are not compatible with newer php version. should be updated when support for 6.4 is dropped
@composer update
Expand Down
7 changes: 0 additions & 7 deletions src/Compatibility/DependencyLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ public function loadServices(): void
$dirFixtures = (string)realpath(__DIR__ . '/../../tests/Fixtures/');

if (is_dir($dirFixtures)) {
# we need to tell Shopware to load our custom fixtures
# from our TEST autoload-dev area....
$classLoader = new ClassLoader();
$classLoader->addPsr4("MolliePayments\\Fixtures\\", $dirFixtures, true);

$classLoader->register();

$loader->load('services/fixtures/fixtures.xml');
}
}
Expand Down
3 changes: 3 additions & 0 deletions switch-composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function moveToDev(array $composerContent, string $swVersion)
unset($composerContent['require']["shopware/administration"]);
unset($composerContent['require']["shopware/storefront"]);

$composerContent['autoload']['psr-4']['MolliePayments\\Fixtures\\'] = "tests/Fixtures/";

return $composerContent;
}

Expand All @@ -54,5 +56,6 @@ function moveToProd(array $composerContent, string $swVersion)
unset($composerContent['require-dev']["shopware/administration"]);
unset($composerContent['require-dev']["shopware/storefront"]);

unset($composerContent['autoload']['psr-4']['MolliePayments\\Fixtures\\']);
return $composerContent;
}

0 comments on commit b129b79

Please sign in to comment.