diff --git a/Bootstrapping/Events/UpdateTransactionsSubscriber.php b/Bootstrapping/Events/UpdateTransactionsSubscriber.php index 11994baf..16f02b58 100644 --- a/Bootstrapping/Events/UpdateTransactionsSubscriber.php +++ b/Bootstrapping/Events/UpdateTransactionsSubscriber.php @@ -78,8 +78,8 @@ private function findCandidateOrdersForUpdate($config) $changeDate = $this->getLastUpdateDate(); if (empty($changeDate)) { - $date = new DateTime(); - $date->sub(new DateInterval('PT1H')); + $date = new \DateTime(); + $date->sub(new \DateInterval('PT1H')); $changeDate = $date->format('Y-m-d H:i:s'); } diff --git a/Component/Mapper/ModelFactory.php b/Component/Mapper/ModelFactory.php index d3352600..0ffda7cc 100755 --- a/Component/Mapper/ModelFactory.php +++ b/Component/Mapper/ModelFactory.php @@ -577,7 +577,7 @@ private function callConfirmationDeliver($operationData) $document = $documentModel->findOneBy(array('orderId' => $operationData['orderId'], 'type' => 1)); if (!is_null($document)) { - $dateObject = new DateTime(); + $dateObject = new \DateTime(); $currentDate = $dateObject->format("Y-m-d"); $currentTime = $dateObject->format("H:m:s"); $currentDateTime = $currentDate . "T" . $currentTime; diff --git a/Component/Validation.php b/Component/Validation.php index 2c9f6f16..22226b41 100755 --- a/Component/Validation.php +++ b/Component/Validation.php @@ -111,7 +111,7 @@ public function isRatePAYPayment() */ public function isAgeValid() { - $today = new DateTime("now"); + $today = new \DateTime("now"); $birthday = $this->_user->getBirthday(); if (empty($birthday) || is_null($birthday)) { 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(); 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 - - - - + + +