From 00655aa5fdae29aa2a781bfeb75bb4cee091839b Mon Sep 17 00:00:00 2001 From: Aaron Whittington Date: Wed, 15 Aug 2018 14:01:19 +0200 Subject: [PATCH 1/2] fix tests --- Tests/Bootstrap.php | 7 +++---- Tests/Functional/Bootstrap.php | 3 +++ Tests/Functional/Component/ValidationTest.php | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tests/Bootstrap.php b/Tests/Bootstrap.php index db6c8d96..5c23deb5 100644 --- a/Tests/Bootstrap.php +++ b/Tests/Bootstrap.php @@ -6,8 +6,7 @@ * Time: 10:16 */ -$env = getenv('TEST_ENV'); -if ('functional' === $env) { - require __DIR__ . '/Functional/Bootstrap.php'; -} + +require __DIR__ . '/Functional/Bootstrap.php'; + diff --git a/Tests/Functional/Bootstrap.php b/Tests/Functional/Bootstrap.php index 6d1e5c09..d5a14e35 100644 --- a/Tests/Functional/Bootstrap.php +++ b/Tests/Functional/Bootstrap.php @@ -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/'); \ No newline at end of file diff --git a/Tests/Functional/Component/ValidationTest.php b/Tests/Functional/Component/ValidationTest.php index 76cc2e11..9ef18e71 100644 --- a/Tests/Functional/Component/ValidationTest.php +++ b/Tests/Functional/Component/ValidationTest.php @@ -6,7 +6,7 @@ * Time: 13:31 */ -namespace RpayRatePay\Tests\Component; +namespace RpayRatePay\Tests\Functional\Component; use Shopware\Components\Test\Plugin\TestCase; @@ -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(); @@ -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(); From 3390c654df5454858aaa1deceadd3aba25e7ec0e Mon Sep 17 00:00:00 2001 From: Aaron Whittington Date: Wed, 15 Aug 2018 15:25:47 +0200 Subject: [PATCH 2/2] add code coverage --- phpunit.xml.dist | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4b2a6831..44bcb083 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,9 +2,9 @@ @@ -22,11 +22,11 @@ ./ Tests + Component/Library - - - - + + +