AnyVersionConstraintTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of PharIo\Version.
  4. *
  5. * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PharIo\Version;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * @covers PharIo\Version\AnyVersionConstraint
  14. */
  15. class AnyVersionConstraintTest extends TestCase {
  16. public function versionProvider() {
  17. return [
  18. [new Version('1.0.2')],
  19. [new Version('4.8')],
  20. [new Version('0.1.1-dev')]
  21. ];
  22. }
  23. /**
  24. * @dataProvider versionProvider
  25. *
  26. * @param Version $version
  27. */
  28. public function testReturnsTrue(Version $version) {
  29. $constraint = new AnyVersionConstraint;
  30. $this->assertTrue($constraint->complies($version));
  31. }
  32. public function testAsString() {
  33. $this->assertSame('*', (new AnyVersionConstraint())->asString());
  34. }
  35. }