@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare( strict_types = 1 ); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace WMDE\Euro\Tests\Unit; |
| 6 | 6 | |
@@ -19,43 +19,43 @@ discard block |
||
| 19 | 19 | use TestTrait; |
| 20 | 20 | |
| 21 | 21 | public function testGivenNegativeAmount_constructorThrowsException() { |
| 22 | - $this->forAll( Generator\neg() ) |
|
| 23 | - ->then( function( int $negativeInteger ) { |
|
| 24 | - $this->expectException( \InvalidArgumentException::class ); |
|
| 25 | - Euro::newFromCents( $negativeInteger ); |
|
| 22 | + $this->forAll(Generator\neg()) |
|
| 23 | + ->then(function(int $negativeInteger) { |
|
| 24 | + $this->expectException(\InvalidArgumentException::class); |
|
| 25 | + Euro::newFromCents($negativeInteger); |
|
| 26 | 26 | } ); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function testGetCentsReturnsConstructorArgument() { |
| 30 | - $this->limitTo( 10000 ) |
|
| 31 | - ->forAll( Generator\choose( 0, 100 * 100 ) ) |
|
| 32 | - ->then( function( int $unsignedInteger ) { |
|
| 33 | - $amount = Euro::newFromCents( $unsignedInteger ); |
|
| 34 | - $this->assertSame( $unsignedInteger, $amount->getEuroCents() ); |
|
| 30 | + $this->limitTo(10000) |
|
| 31 | + ->forAll(Generator\choose(0, 100 * 100)) |
|
| 32 | + ->then(function(int $unsignedInteger) { |
|
| 33 | + $amount = Euro::newFromCents($unsignedInteger); |
|
| 34 | + $this->assertSame($unsignedInteger, $amount->getEuroCents()); |
|
| 35 | 35 | } ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function testEquality() { |
| 39 | - $this->limitTo( 10000 ) |
|
| 40 | - ->forAll( Generator\choose( 0, 100 * 100 ) ) |
|
| 41 | - ->then( function( int $unsignedInteger ) { |
|
| 42 | - $amount = Euro::newFromCents( $unsignedInteger ); |
|
| 43 | - $this->assertTrue( $amount->equals( Euro::newFromCents( $unsignedInteger ) ) ); |
|
| 39 | + $this->limitTo(10000) |
|
| 40 | + ->forAll(Generator\choose(0, 100 * 100)) |
|
| 41 | + ->then(function(int $unsignedInteger) { |
|
| 42 | + $amount = Euro::newFromCents($unsignedInteger); |
|
| 43 | + $this->assertTrue($amount->equals(Euro::newFromCents($unsignedInteger))); |
|
| 44 | 44 | } ); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function testNewFromString() { |
| 48 | - $this->limitTo( 10000 ) |
|
| 49 | - ->forAll( Generator\choose( 0, 100 ), Generator\choose( 0, 99 ) ) |
|
| 50 | - ->then( function( int $firstInt, int $secondInt ) { |
|
| 48 | + $this->limitTo(10000) |
|
| 49 | + ->forAll(Generator\choose(0, 100), Generator\choose(0, 99)) |
|
| 50 | + ->then(function(int $firstInt, int $secondInt) { |
|
| 51 | 51 | $euroString = |
| 52 | - (string)$firstInt |
|
| 52 | + (string) $firstInt |
|
| 53 | 53 | . '.' |
| 54 | - . str_pad( (string)$secondInt, 2, '0', STR_PAD_LEFT ); |
|
| 54 | + . str_pad((string) $secondInt, 2, '0', STR_PAD_LEFT); |
|
| 55 | 55 | |
| 56 | 56 | $this->assertSame( |
| 57 | 57 | $firstInt * 100 + $secondInt, |
| 58 | - Euro::newFromString( $euroString )->getEuroCents() |
|
| 58 | + Euro::newFromString($euroString)->getEuroCents() |
|
| 59 | 59 | ); |
| 60 | 60 | } ); |
| 61 | 61 | } |