Skip to content

Commit

Permalink
Merge pull request #9 in DEV-MO/shopware5-module from task/fix-tests …
Browse files Browse the repository at this point in the history
…to release/5.2.1

* commit '3390c654df5454858aaa1deceadd3aba25e7ec0e':
  add code coverage
  fix tests
  • Loading branch information
MTroesken committed Aug 16, 2018
2 parents cb7adb8 + 3390c65 commit 48f71f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
7 changes: 3 additions & 4 deletions Tests/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
* Time: 10:16
*/

$env = getenv('TEST_ENV');
if ('functional' === $env) {
require __DIR__ . '/Functional/Bootstrap.php';
}

require __DIR__ . '/Functional/Bootstrap.php';


3 changes: 3 additions & 0 deletions Tests/Functional/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
ini_set('display_startup_errors', '1');

require __DIR__ . '/../../../../../../../../tests/Functional/bootstrap.php';

Shopware()->Loader()->registerNamespace('RpayRatePay', __DIR__ . '/../../');
Shopware()->Loader()->registerNamespace('RatePAY', __DIR__ . '/../../Component/Library/src/');
6 changes: 3 additions & 3 deletions Tests/Functional/Component/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 13:31
*/

namespace RpayRatePay\Tests\Component;
namespace RpayRatePay\Tests\Functional\Component;

use Shopware\Components\Test\Plugin\TestCase;

Expand All @@ -20,7 +20,7 @@ public function testIsBirthdayValid__tooYoung()

Shopware()->Session()->sUserId = $customer->getId();

$validator = new \Shopware_Plugins_Frontend_RpayRatePay_Component_Validation();
$validator = new \Shopware_Plugins_Frontend_RpayRatePay_Component_Validation($customer);
$oldBirthday = $customer->getBirthday();

$aDayTooYoung = $this->findTurns18Tomorrow();
Expand All @@ -40,7 +40,7 @@ public function testIsBirthdayValid__justOldEnough()
$customer = $this->getRandomCustomer();
Shopware()->Session()->sUserId = $customer->getId();

$validator = new \Shopware_Plugins_Frontend_RpayRatePay_Component_Validation();
$validator = new \Shopware_Plugins_Frontend_RpayRatePay_Component_Validation($customer);
$oldBirthday = $customer->getBirthday();

$oldEnough = $this->findTurns18Today();
Expand Down
14 changes: 7 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<phpunit bootstrap="Tests/Bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="false"
beStrictAboutOutputDuringTests="false"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">

Expand All @@ -22,11 +22,11 @@
<directory suffix=".php">./</directory>
<exclude>
<directory suffix=".php">Tests</directory>
<directory suffix=".php">Component/Library</directory>
</exclude>
</whitelist>
</filter>

<php>
<env name="TEST_ENV" value="unit"/>
</php>
<logging>
<log type="coverage-text" target="php://stdout"/>
</logging>
</phpunit>

0 comments on commit 48f71f1

Please sign in to comment.