1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Detect ~> misuse and suggest fix, fixes #2476

This commit is contained in:
Jordi Boggiano 2013-12-06 11:57:37 +01:00
parent 45c8d5c817
commit 80499bb024
2 changed files with 18 additions and 1 deletions

View file

@ -181,6 +181,16 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
$this->assertSame((string) new VersionConstraint('=', '1.0.0.0'), (string) $parser->parseConstraints('1.0#trunk/@123'));
}
/**
* @expectedException UnexpectedValueException
* @expectedExceptionMessage Invalid operator "~>", you probably meant to use the "~" operator
*/
public function testParseConstraintsNudgesRubyDevsTowardsThePathOfRighteousness()
{
$parser = new VersionParser;
$parser->parseConstraints('~>1.2');
}
/**
* @dataProvider simpleConstraints
*/