Skip to content

Commit

Permalink
Merge pull request #18 from shouze/atoum/upgradeTo2.0
Browse files Browse the repository at this point in the history
Upgrades: Atoum 2.0, php 7 in ci matrix
  • Loading branch information
shouze committed Dec 15, 2015
2 parents a85a74f + f02c60e commit cfff627
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
language: php

dist: trusty
sudo: false

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0

before_script:
- mkdir -p web/code-coverage
- composer install --dev --prefer-source
- composer install --dev --prefer-source --optimize-autoloader

script:
- bin/atoum
- bin/atoum -ulr

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php-soap": "Mandatory for usage of ViesValidator"
},
"require-dev": {
"atoum/atoum": "*@dev"
"atoum/atoum": "~1.0|~2.0"
},
"autoload": {
"psr-0": {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Constraints/VatValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testValidNumber($number)
{
$this
->if($validator = Validation::createValidator())
->object(($validator->validateValue($number, new Vat)))
->object(($validator->validate($number, new Vat)))
->isInstanceOf('Symfony\Component\Validator\ConstraintViolationList')
->hasSize(0)
;
Expand All @@ -34,7 +34,7 @@ public function testInvalidNumber($number)
{
$this
->if($validator = Validation::createValidator())
->object(($validator->validateValue($number, new Vat)))
->object(($validator->validate($number, new Vat)))
->isInstanceOf('Symfony\Component\Validator\ConstraintViolationList')
->hasSize(1)
;
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/Operation/Amount/Percentage.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testConstruct($value, $expectedValue)
{
$this
->if($percentage = new TestedPercentage($value))
->float($percentage->getValue())
->phpFloat($percentage->getValue())
->isIdenticalTo($expectedValue)
->if($level = $percentage->getLevel())
->integer($level)
Expand All @@ -39,7 +39,7 @@ public function testToString($value, $expectedValue)
{
$this
->if($percentage = new TestedPercentage($value))
->string((string) $percentage)
->phpString((string) $percentage)
->isIdenticalTo($expectedValue)
;
}
Expand All @@ -50,9 +50,9 @@ public function testComputeWithPercentage($operation, $left, $right, $expectedRe
->if($percentage = new TestedPercentage($left))
->object($result = $percentage->compute($operation, new TestedPercentage($right)))
->isInstanceOf('\Rezzza\Accounting\Operation\Amount\Result')
->float($result->getValue()->getValue())
->phpFloat($result->getValue()->getValue())
->isEqualTo($expectedResult)
->float($result->getComplement()->getValue())
->phpFloat($result->getComplement()->getValue())
->isEqualTo($expectedResultComplement)
;
}
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/Operation/Amount/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public function testConstruct($value, $currencyCode, $expectedValue, $expectedCu
{
$this
->if($price = new TestedPrice($value, $currencyCode))
->float($price->getValue())
->phpFloat($price->getValue())
->isIdenticalTo($expectedValue)
->string($price->getCurrency())
->phpString($price->getCurrency())
->isIdenticalTo($expectedCurrencyCode)
;
}
Expand All @@ -41,7 +41,7 @@ public function testToString($value, $currencyCode, $expectedOutput)
}
$this
->if($price = new TestedPrice($value, $currencyCode))
->string((string) $price)
->phpString((string) $price)
->isIdenticalTo($expectedOutput)
;
}
Expand Down Expand Up @@ -90,9 +90,9 @@ public function testComputeWithPrice($operation, $left, $right, $expectedResult,
->if($price = new TestedPrice($left))
->object($result = $price->compute($operation, new TestedPrice($right)))
->isInstanceOf('\Rezzza\Accounting\Operation\Amount\Result')
->float($result->getValue()->getValue())
->phpFloat($result->getValue()->getValue())
->isEqualTo($expectedResult)
->float($result->getComplement()->getValue())
->phpFloat($result->getComplement()->getValue())
->isEqualTo($expectedResultComplement)
;
}
Expand All @@ -117,9 +117,9 @@ public function testComputeWithPercent($operation, $left, $right, $expectedResul
->if($price = new TestedPrice($left))
->object($result = $price->compute($operation, new \mock\Rezzza\Accounting\Operation\Amount\Percentage($right)))
->isInstanceOf('\Rezzza\Accounting\Operation\Amount\Result')
->float($result->getValue()->getValue())
->phpFloat($result->getValue()->getValue())
->isEqualTo($expectedResult)
->float($result->getComplement()->getValue())
->phpFloat($result->getComplement()->getValue())
->isEqualTo($expectedResultComplement)
;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/Vat/VatNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testConstruct($countryCode, $number, $expectedOutput)
{
$this
->if($vatNumber = new TestedVatNumber($countryCode, $number))
->string((string) $vatNumber)
->phpString((string) $vatNumber)
->isIdenticalTo($expectedOutput)
;
}
Expand All @@ -31,7 +31,7 @@ public function testFromString($input, $expectedOutput)
{
$this
->if($vatNumber = new TestedVatNumber)
->string((string) $vatNumber->fromString($input))
->phpString((string) $vatNumber->fromString($input))
->isIdenticalTo($expectedOutput)
;
}
Expand All @@ -41,7 +41,7 @@ public function testValidCountryCode($countryCode, $expectedCountryCode)
$this
->if($vatNumber = new TestedVatNumber)
->and($vatNumber->setCountryCode($countryCode))
->string($vatNumber->getCountryCode())
->phpString($vatNumber->getCountryCode())
->isIdenticalTo($expectedCountryCode)
;
}
Expand Down Expand Up @@ -78,7 +78,7 @@ public function testValidNumber($number, $expectedNumber)
$this
->if($vatNumber = new TestedVatNumber)
->and($vatNumber->setNumber($number))
->string($vatNumber->getNumber())
->phpString($vatNumber->getNumber())
->isIdenticalTo($expectedNumber)
;
}
Expand Down

0 comments on commit cfff627

Please sign in to comment.