Closed nlubisch closed 5 years ago
Our minimized solution
# bootstrap.php
(new \Shopware\Kernel('testing', true))->boot();
# phpunit.xml.dist
<phpunit bootstrap="tests/bootstrap.php">
<testsuite name="Foobar Test Suite">
<directory>tests</directory>
</testsuite>
</phpunit>
# PluginTestCase .php
class PluginTestCase extends \PHPUnit_Framework_TestCase
{
/**
* Set up Test Case
*/
protected function setUp()
{
parent::setUp();
Shopware()->Loader()->registerNamespace(
'Foobar',
Shopware()->Plugins()->Frontend()->Foobar()->Path()
);
}
}
@nlubisch does the solution of @Haehnchen help?
I'm not sure, what the result was. It's about 2 years ago :see_no_evil:
ok, I will close this issue for now. If there is a problem, feel free to open an issue again. we try to solve them faster in the future :see_no_evil:
Scenario: Customer has Shopware 5.1, all plugins and tests are written under SW5.1. The Customer wishes an update to SW5.2.
Problem: The legacy PluginCreator copies the phpunit.xml.dist with bootstrap "../../../../../../tests/Shopware/TestHelper.php" But under SW5.2 the whole tests/Shopware dir gots deleted und the tests are not working.
Is there probably a way to provide both test-scenarios for legacy and new plugin structure?