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:
parent
45c8d5c817
commit
80499bb024
2 changed files with 18 additions and 1 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue