Skip to content

Commit

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

* commit '48f71f11c34afb7cf1c317c838c10a5a4baae4a1':
  [ETS-33] Fix Cron Job Fehler - Class Not Found Error
  [ETS-33] Fix Cron Job Fehler - Class Not Found Error
  [ETS-33] Fix Cron Job Fehler - Class Not Found Error
  add code coverage
  fix tests
  • Loading branch information
rpWhittington committed Aug 16, 2018
2 parents 71b1ceb + 48f71f1 commit 7ac9e1e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Bootstrapping/Events/UpdateTransactionsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion Component/Mapper/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Component/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
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 7ac9e1e

Please sign in to comment.