| @@ 81-95 (lines=15) @@ | ||
| 78 | * @coverage VersionComponent::toString |
|
| 79 | * @dataProvider versionComponentToStringMethodArgumentsProvider |
|
| 80 | */ |
|
| 81 | public function testPerformsConversionToString($expected, VersionComponent $versionComponent) |
|
| 82 | { |
|
| 83 | $actual = $versionComponent->toString(); |
|
| 84 | ||
| 85 | $message = String::format( |
|
| 86 | '$versionComponent->{method}(); // {actual}', |
|
| 87 | [ |
|
| 88 | 'method' => 'toString', |
|
| 89 | 'actual' => static::export($actual) |
|
| 90 | ] |
|
| 91 | ); |
|
| 92 | ||
| 93 | $this->assertInternalType('string', $actual, $message.' # Should return a string #'); |
|
| 94 | $this->assertEquals($expected, $actual, $message); |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * @coverage VersionComponent::__toString |
|
| @@ 62-76 (lines=15) @@ | ||
| 59 | * @depends NelsonMartell\Test\TestCase\VersionComponentTest::testPerformsConversionToString |
|
| 60 | * @dataProvider toStringMethodProvider |
|
| 61 | */ |
|
| 62 | public function testPerformsConversionToString($expected, Version $version) |
|
| 63 | { |
|
| 64 | $actual = $version->toString(); |
|
| 65 | ||
| 66 | $message = String::format( |
|
| 67 | '$version->{method}(); // {actual}', |
|
| 68 | [ |
|
| 69 | 'method' => 'toString', |
|
| 70 | 'actual' => static::export($actual) |
|
| 71 | ] |
|
| 72 | ); |
|
| 73 | ||
| 74 | $this->assertInternalType('string', $actual, $message.' # Should return a string #'); |
|
| 75 | $this->assertEquals($expected, $actual, $message); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @coverage Version::__toString |
|