| @@ 35-44 (lines=10) @@ | ||
| 32 | * @param string $version Version. |
|
| 33 | * @param string|InvalidArgumentException $expect Expected result. |
|
| 34 | */ |
|
| 35 | public function testNormalizeVersion( $version, $expect ) { |
|
| 36 | $obj = new SemverVersioning( array() ); |
|
| 37 | if ( $expect instanceof InvalidArgumentException ) { |
|
| 38 | $this->expectException( InvalidArgumentException::class ); |
|
| 39 | $this->expectExceptionMessage( $expect->getMessage() ); |
|
| 40 | $obj->normalizeVersion( $version ); |
|
| 41 | } else { |
|
| 42 | $this->assertSame( $expect, $obj->normalizeVersion( $version ) ); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Data provider for testNormalizeVersion. |
|
| @@ 49-58 (lines=10) @@ | ||
| 46 | * @param string $version Version. |
|
| 47 | * @param string|InvalidArgumentException $expect Expected result. |
|
| 48 | */ |
|
| 49 | public function testNormalizeVersion( $version, $expect ) { |
|
| 50 | $obj = new WordpressVersioning( array() ); |
|
| 51 | if ( $expect instanceof InvalidArgumentException ) { |
|
| 52 | $this->expectException( InvalidArgumentException::class ); |
|
| 53 | $this->expectExceptionMessage( $expect->getMessage() ); |
|
| 54 | $obj->normalizeVersion( $version ); |
|
| 55 | } else { |
|
| 56 | $this->assertSame( $expect, $obj->normalizeVersion( $version ) ); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Data provider for testNormalizeVersion. |
|