Skip to content

Commit

Permalink
Try run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed Jan 16, 2024
1 parent d4cacb3 commit 0cf1874
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 372 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,26 @@ jobs:
extensionName: SwagPayPal
shopwareVersion: trunk
phpunit:
strategy:
fail-fast: false
matrix:
shopware-version:
- trunk
uses: shopware/github-actions/.github/workflows/phpunit.yml@main
with:
extensionName: SwagPayPal
shopwareVersion: ${{ matrix.shopware-version }}
uploadCoverage: true
secrets:
codecovToken: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Setup Shopware
uses: FriendsOfShopware/setup-shopware@main
with:
shopware-version: trunk
php-version: 8.2
php-extensions: pcov
- name: Clone Extension
uses: actions/checkout@v4
with:
path: custom/plugins/SwagPayPal
- name: Dump autoload
uses: php-actions/composer@v6
with:
command: dump-autoload
working_dir: custom/plugins/SwagPayPal
- name: Run PHPUnit
working-directory: custom/plugins/SwagPayPal
run: ${{ github.workspace }}/vendor/bin/phpunit --coverage-clover clover.xml




10 changes: 6 additions & 4 deletions tests/TestBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
} elseif (is_readable(__DIR__ . '/../vendor/shopware/core/TestBootstrapper.php')) {
require __DIR__ . '/../vendor/shopware/core/TestBootstrapper.php';
} else {
// vendored from platform, only use local TestBootstrapper if not already defined in platform
require __DIR__ . '/TestBootstrapper.php';
require __DIR__ . '/../../../../src/Core/TestBootstrapper.php';
}

if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
require dirname(__DIR__) . '/vendor/autoload.php';
}

return (new TestBootstrapper())
->setProjectDir($_SERVER['PROJECT_ROOT'] ?? dirname(__DIR__, 4))
->setLoadEnvFile(true)
->setForceInstallPlugins(true)
->addActivePlugins('SwagCmsExtensions')
//->addActivePlugins('SwagCmsExtensions')
->addCallingPlugin()
->bootstrap()
->setClassLoader(require dirname(__DIR__) . '/vendor/autoload.php')
->getClassLoader();
Loading

0 comments on commit 0cf1874

Please sign in to comment.