This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
neustadt
committed
Jan 21, 2019
1 parent
fbf3b3e
commit f8983d1
Showing
6 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,8 @@ | |
}, | ||
"require": { | ||
"composer/installers": "~1.0" | ||
}, | ||
"scripts": { | ||
"test": "phpunit -c tests" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* Shopware 5 | ||
* Copyright (c) shopware AG. | ||
* | ||
* According to our dual licensing model, this program can be used either | ||
* under the terms of the GNU Affero General Public License, version 3, | ||
* or under a proprietary license. | ||
* | ||
* The texts of the GNU Affero General Public License with an additional | ||
* permission and of our proprietary license can be found at and | ||
* in the LICENSE file you have received along with this program. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* "Shopware" is a registered trademark of shopware AG. | ||
* The licensing of the program under the AGPLv3 does not imply a | ||
* trademark license. Therefore any rights, title and interest in | ||
* our trademarks remain entirely with us. | ||
*/ | ||
use Shopware\Models\Shop\Shop; | ||
|
||
require __DIR__ . '/../../../../../autoload.php'; | ||
|
||
class TestKernel extends \Shopware\Kernel | ||
{ | ||
/** | ||
* Static method to start boot kernel without leaving local scope in test helper. | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function start() | ||
{ | ||
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | ||
$kernel = new self('testing', true); | ||
$kernel->boot(); | ||
$container = $kernel->getContainer(); | ||
$container->get('plugins')->Core()->ErrorHandler()->registerErrorHandler(E_ALL | E_STRICT); | ||
/** @var $repository \Shopware\Models\Shop\Repository */ | ||
$repository = $container->get('models')->getRepository(Shop::class); | ||
$shop = $repository->getActiveDefault(); | ||
$shop->registerResources(); | ||
$_SERVER['HTTP_HOST'] = $shop->getHost(); | ||
} | ||
|
||
protected function getConfigPath() | ||
{ | ||
return __DIR__ . '/config.php'; | ||
} | ||
} | ||
|
||
TestKernel::start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
return array_merge($this->loadConfig($this->AppPath() . 'Configs/Default.php'), [ | ||
'front' => [ | ||
'throwExceptions' => true, | ||
'disableOutputBuffering' => false, | ||
'showException' => true, | ||
], | ||
'errorHandler' => [ | ||
'throwOnRecoverableError' => true, | ||
], | ||
'session' => [ | ||
'unitTestEnabled' => true, | ||
'name' => 'SHOPWARESID', | ||
'cookie_lifetime' => 0, | ||
'use_trans_sid' => false, | ||
'gc_probability' => 1, | ||
'gc_divisor' => 100, | ||
'save_handler' => 'db', | ||
], | ||
'mail' => [ | ||
'type' => 'file', | ||
'path' => $this->getCacheDir(), | ||
], | ||
'phpSettings' => [ | ||
'error_reporting' => E_ALL, | ||
'display_errors' => 1, | ||
'date.timezone' => 'Europe/Berlin', | ||
'max_execution_time' => 0, | ||
], | ||
'csrfProtection' => [ | ||
'frontend' => false, | ||
'backend' => false, | ||
], | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.5/phpunit.xsd" | ||
bootstrap="./Unit/bootstrap.php" | ||
colors="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutResourceUsageDuringSmallTests="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
verbose="true"> | ||
|
||
<testsuites> | ||
<testsuite name="DataTableLayout"> | ||
<directory>./Functional</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<groups> | ||
<exclude> | ||
<group>disable</group> | ||
</exclude> | ||
</groups> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">../engine/Shopware/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |