Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Fix code style issues and add php7.2 support to travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
devheidelpay committed Feb 21, 2017
1 parent aee0d18 commit ed07f31
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ matrix:
env: deps=low
- php: 7.1
env: deps=high
php: 7.2
env: deps=no
php: 7.2
env: deps=low
php: 7.2
env: deps=high


cache:
directories:
Expand All @@ -34,7 +41,6 @@ before_script:

script:
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- ./vendor/bin/phpunit
- ./vendor/bin/php-cs-fixer fix --dry-run --diff --verbose

after_success:
Expand Down
1 change: 0 additions & 1 deletion lib/ParameterGroups/AccountParameterGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public function getIban()
return $this->iban;
}


/**
* AccountIdentification getter
*
Expand Down
1 change: 0 additions & 1 deletion lib/ParameterGroups/BasketParameterGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class BasketParameterGroup extends AbstractParameterGroup
* @var string reference id of a transmitted basket (optional)
*/
public $id = null;


/**
* BasketId getter
Expand Down
3 changes: 1 addition & 2 deletions lib/PaymentMethodes/AbstractPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* @subpackage PhpApi
* @category PhpApi
*/

use \Heidelpay\PhpApi\Exceptions\UndefinedTransactionModeException;
use Heidelpay\PhpApi\Exceptions\UndefinedTransactionModeException;

abstract class AbstractPaymentMethod
{
Expand Down
9 changes: 6 additions & 3 deletions tests/Unit/ParameterGroups/AccountParameterGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AccountParameterGroupTest extends TestCase
{
/**
* Bank getter/setter test
*
* @test
*/
public function Bank()
Expand All @@ -35,9 +36,9 @@ public function Bank()

/**
* BankName getter/setter test
*
* @test
*/

public function BankName()
{
$Account = new Account();
Expand All @@ -63,6 +64,7 @@ public function testBrand()

/**
* Bic getter/setter test
*
* @test
*/
public function Bic()
Expand All @@ -75,9 +77,9 @@ public function Bic()
$this->assertEquals($value, $Account->getBic());
}


/**
* Country getter/setter test
*
* @test
*/
public function Country()
Expand Down Expand Up @@ -116,9 +118,9 @@ public function testIban()
$this->assertEquals($value, $Account->getIban());
}


/**
* Sepa Mandate Identification getter/setter test
*
* @test
*/
public function Identification()
Expand Down Expand Up @@ -172,6 +174,7 @@ public function testNumber()

/**
* Verification getter/setter test
*
* @test
*/
public function Verification()
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/ParameterGroups/BasketParameterGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class BasketParameterGroupTest extends TestCase
{
/**
* BasketId getter/setter test
*
* @test
*/
public function Id()
Expand All @@ -36,19 +37,20 @@ public function Id()

/**
* GetClassName test
*
* @test
*/

public function getClassName()
{
$Basket = new Basket();

$value = "Heidelpay\PhpApi\ParameterGroups\BasketParameterGroup";
$this->assertEquals($value,$Basket->getClassName());
$this->assertEquals($value, $Basket->getClassName());
}

/**
* Undefined property exception test
*
* @test
*/
public function undefinedPropertyExcetion()
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ParameterGroups/ContactParameterGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function testIp()

/**
* Mobile setter/getter test
*
* @test
*/
public function Mobile()
Expand All @@ -61,6 +62,7 @@ public function Mobile()

/**
* Phone setter/getter test
*
* @test
*/
public function Phone()
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/ParameterGroups/NameParameterGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NameParameterGroupTest extends TestCase
{
/**
* Birthdate getter/setter test
*
* @test
*/
public function Birthdate()
Expand Down Expand Up @@ -74,6 +75,7 @@ public function testFamily()

/**
* Salutation getter/setter test
*
* @test
*/
public function Salutation()
Expand All @@ -85,8 +87,10 @@ public function Salutation()

$this->assertEquals($value, $Name->getSalutation());
}

/**
* Title getter/setter test
*
* @test
*/
public function Title()
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/PaymentMethodes/AbstractPaymentMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class AbstractPaymentMethodTest extends TestCase
*
* @var \Heidelpay\PhpApi\PaymentMethodes\SofortPaymentMethod
*/

protected $paymentObject = null;

/**
Expand All @@ -49,6 +48,7 @@ public function setUp()

/**
* Request setter/getter test
*
* @test
*/
public function Request()
Expand All @@ -61,6 +61,7 @@ public function Request()

/**
* Response setter/getter test
*
* @test
*/
public function Response()
Expand All @@ -70,6 +71,7 @@ public function Response()

/**
* Adaptere setter/getter test
*
* @test
*/
public function Adapter()
Expand All @@ -82,26 +84,24 @@ public function Adapter()

/**
* getPaymentUrl test
*
* @test
*/
public function getPaymentUrl()
{

$this->paymentObject->getRequest()->getTransaction()->set('mode', 'LIVE');
$this->assertEquals('https://heidelpay.hpcgw.net/ngw/post', $this->paymentObject->getPaymentUrl());
}

/**
* getPaymentUrl exception test
*
* @test
*/
public function getPaymentUrlException()
{
$this->paymentObject->getRequest()->getTransaction()->set('mode', null);
$this->expectException(UndefinedTransactionModeException::class);
$this->paymentObject->getPaymentUrl();


}

}

0 comments on commit ed07f31

Please sign in to comment.