12 namespace Symfony\Component\Finder\Tests\Comparator;
23 foreach ($successes as $s) {
27 foreach ($failures as $f) {
30 $this->fail(
'__construct() throws an \InvalidArgumentException if the test expression is not valid.');
31 }
catch (\Exception $e) {
32 $this->assertInstanceOf(
'InvalidArgumentException', $e,
'__construct() throws an \InvalidArgumentException if the test expression is not valid.');
40 public function testTest($test, $match, $noMatch)
44 foreach ($match as $m) {
45 $this->assertTrue($c->test($m),
'->test() tests a string against the expression');
48 foreach ($noMatch as $m) {
49 $this->assertFalse($c->test($m),
'->test() tests a string against the expression');
56 array(
'< 1000', array(
'500',
'999'), array(
'1000',
'1500')),
58 array(
'< 1K', array(
'500',
'999'), array(
'1000',
'1500')),
59 array(
'<1k', array(
'500',
'999'), array(
'1000',
'1500')),
60 array(
' < 1 K ', array(
'500',
'999'), array(
'1000',
'1500')),
61 array(
'<= 1K', array(
'1000'), array(
'1001')),
62 array(
'> 1K', array(
'1001'), array(
'1000')),
63 array(
'>= 1K', array(
'1000'), array(
'999')),
65 array(
'< 1KI', array(
'500',
'1023'), array(
'1024',
'1500')),
66 array(
'<= 1KI', array(
'1024'), array(
'1025')),
67 array(
'> 1KI', array(
'1025'), array(
'1024')),
68 array(
'>= 1KI', array(
'1024'), array(
'1023')),
70 array(
'1KI', array(
'1024'), array(
'1023',
'1025')),
71 array(
'==1KI', array(
'1024'), array(
'1023',
'1025')),
73 array(
'==1m', array(
'1000000'), array(
'999999',
'1000001')),
74 array(
'==1mi', array(1024 * 1024), array(1024 * 1024 - 1, 1024 * 1024 + 1)),
76 array(
'==1g', array(
'1000000000'), array(
'999999999',
'1000000001')),
77 array(
'==1gi', array(1024 * 1024 * 1024), array(1024 * 1024 * 1024 - 1, 1024 * 1024 * 1024 + 1)),
79 array(
'!= 1000', array(
'500',
'999'), array(
'1000')),
89 '3.5',
'33.55',
'123.456',
'123456.78',
93 '==1',
'!=1',
'<1',
'>1',
'<=1',
'>=1',
94 '==1k',
'==1ki',
'==1m',
'==1mi',
'==1g',
'==1gi',
95 '1k',
'1ki',
'1m',
'1mi',
'1g',
'1gi',
101 '0 . 1',
'123 .45',
'234. 567',
102 '..',
'.0.',
'0.1.2',