Lines Matching refs:constraint

15         $constraint = PHPUnit_Framework_Assert::arrayHasKey(0);
17 $this->assertFalse($constraint->evaluate([], '', true));
18 $this->assertEquals('has the key 0', $constraint->toString());
19 $this->assertCount(1, $constraint);
22 $constraint->evaluate([]);
40 $constraint = PHPUnit_Framework_Assert::arrayHasKey(0);
43 $constraint->evaluate([], 'custom message');
62 $constraint = PHPUnit_Framework_Assert::logicalNot(
66 $this->assertFalse($constraint->evaluate([0 => 1], '', true));
67 $this->assertEquals('does not have the key 0', $constraint->toString());
68 $this->assertCount(1, $constraint);
71 $constraint->evaluate([0 => 1]);
90 $constraint = PHPUnit_Framework_Assert::logicalNot(
95 $constraint->evaluate([0], 'custom message');
115 $constraint = PHPUnit_Framework_Assert::isReadable();
117 $this->assertFalse($constraint->evaluate('foo', '', true));
118 $this->assertEquals('is readable', $constraint->toString());
119 $this->assertCount(1, $constraint);
122 $constraint->evaluate('foo');
141 $constraint = PHPUnit_Framework_Assert::isWritable();
143 $this->assertFalse($constraint->evaluate('foo', '', true));
144 $this->assertEquals('is writable', $constraint->toString());
145 $this->assertCount(1, $constraint);
148 $constraint->evaluate('foo');
167 $constraint = PHPUnit_Framework_Assert::directoryExists();
169 $this->assertFalse($constraint->evaluate('foo', '', true));
170 $this->assertEquals('directory exists', $constraint->toString());
171 $this->assertCount(1, $constraint);
174 $constraint->evaluate('foo');
193 $constraint = PHPUnit_Framework_Assert::fileExists();
195 $this->assertFalse($constraint->evaluate('foo', '', true));
196 $this->assertEquals('file exists', $constraint->toString());
197 $this->assertCount(1, $constraint);
200 $constraint->evaluate('foo');
219 $constraint = PHPUnit_Framework_Assert::fileExists();
222 $constraint->evaluate('foo', 'custom message');
243 $constraint = PHPUnit_Framework_Assert::logicalNot(
247 $this->assertFalse($constraint->evaluate($file, '', true));
248 $this->assertEquals('file does not exist', $constraint->toString());
249 $this->assertCount(1, $constraint);
252 $constraint->evaluate($file);
273 $constraint = PHPUnit_Framework_Assert::logicalNot(
278 $constraint->evaluate($file, 'custom message');
297 $constraint = PHPUnit_Framework_Assert::greaterThan(1);
299 $this->assertFalse($constraint->evaluate(0, '', true));
300 $this->assertTrue($constraint->evaluate(2, '', true));
301 $this->assertEquals('is greater than 1', $constraint->toString());
302 $this->assertCount(1, $constraint);
305 $constraint->evaluate(0);
324 $constraint = PHPUnit_Framework_Assert::greaterThan(1);
327 $constraint->evaluate(0, 'custom message');
347 $constraint = PHPUnit_Framework_Assert::logicalNot(
351 $this->assertTrue($constraint->evaluate(1, '', true));
352 $this->assertEquals('is not greater than 1', $constraint->toString());
353 $this->assertCount(1, $constraint);
356 $constraint->evaluate(2);
375 $constraint = PHPUnit_Framework_Assert::logicalNot(
380 $constraint->evaluate(2, 'custom message');
400 $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1);
402 $this->assertTrue($constraint->evaluate(1, '', true));
403 $this->assertFalse($constraint->evaluate(0, '', true));
404 $this->assertEquals('is equal to 1 or is greater than 1', $constraint->toString());
405 $this->assertCount(2, $constraint);
408 $constraint->evaluate(0);
427 $constraint = PHPUnit_Framework_Assert::greaterThanOrEqual(1);
430 $constraint->evaluate(0, 'custom message');
450 $constraint = PHPUnit_Framework_Assert::logicalNot(
454 $this->assertFalse($constraint->evaluate(1, '', true));
455 $this->assertEquals('not( is equal to 1 or is greater than 1 )', $constraint->toString());
456 $this->assertCount(2, $constraint);
459 $constraint->evaluate(1);
478 $constraint = PHPUnit_Framework_Assert::logicalNot(
483 $constraint->evaluate(1, 'custom message');
503 $constraint = PHPUnit_Framework_Assert::anything();
505 $this->assertTrue($constraint->evaluate(null, '', true));
506 $this->assertNull($constraint->evaluate(null));
507 $this->assertEquals('is anything', $constraint->toString());
508 $this->assertCount(0, $constraint);
513 $constraint = PHPUnit_Framework_Assert::logicalNot(
517 $this->assertFalse($constraint->evaluate(null, '', true));
518 $this->assertEquals('is not anything', $constraint->toString());
519 $this->assertCount(0, $constraint);
522 $constraint->evaluate(null);
541 $constraint = PHPUnit_Framework_Assert::equalTo(1);
543 $this->assertTrue($constraint->evaluate(1, '', true));
544 $this->assertFalse($constraint->evaluate(0, '', true));
545 $this->assertEquals('is equal to 1', $constraint->toString());
546 $this->assertCount(1, $constraint);
549 $constraint->evaluate(0);
829 $constraint = PHPUnit_Framework_Assert::equalTo($expected);
832 $constraint->evaluate($actual, 'custom message');
847 $constraint = PHPUnit_Framework_Assert::logicalNot(
851 $this->assertTrue($constraint->evaluate(0, '', true));
852 $this->assertFalse($constraint->evaluate(1, '', true));
853 $this->assertEquals('is not equal to 1', $constraint->toString());
854 $this->assertCount(1, $constraint);
857 $constraint->evaluate(1);
876 $constraint = PHPUnit_Framework_Assert::logicalNot(
881 $constraint->evaluate(1, 'custom message');
904 $constraint = PHPUnit_Framework_Assert::identicalTo($a);
906 $this->assertFalse($constraint->evaluate($b, '', true));
907 $this->assertTrue($constraint->evaluate($a, '', true));
908 … $this->assertEquals('is identical to an object of class "stdClass"', $constraint->toString());
909 $this->assertCount(1, $constraint);
912 $constraint->evaluate($b);
933 $constraint = PHPUnit_Framework_Assert::identicalTo($a);
936 $constraint->evaluate($b, 'custom message');
955 $constraint = PHPUnit_Framework_Assert::identicalTo('a');
958 $constraint->evaluate('b', 'custom message');
985 $constraint = PHPUnit_Framework_Assert::logicalNot(
989 $this->assertTrue($constraint->evaluate($b, '', true));
990 $this->assertFalse($constraint->evaluate($a, '', true));
991 … $this->assertEquals('is not identical to an object of class "stdClass"', $constraint->toString());
992 $this->assertCount(1, $constraint);
995 $constraint->evaluate($a);
1015 $constraint = PHPUnit_Framework_Assert::logicalNot(
1020 $constraint->evaluate($a, 'custom message');
1039 $constraint = PHPUnit_Framework_Assert::logicalNot(
1044 $constraint->evaluate('a', 'custom message');
1063 $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception');
1065 $this->assertFalse($constraint->evaluate(new stdClass, '', true));
1066 $this->assertTrue($constraint->evaluate(new Exception, '', true));
1067 $this->assertEquals('is instance of class "Exception"', $constraint->toString());
1068 $this->assertCount(1, $constraint);
1076 $constraint->evaluate(new stdClass);
1095 $constraint = PHPUnit_Framework_Assert::isInstanceOf('Exception');
1098 $constraint->evaluate(new stdClass, 'custom message');
1117 $constraint = PHPUnit_Framework_Assert::logicalNot(
1121 $this->assertFalse($constraint->evaluate(new stdClass, '', true));
1122 $this->assertTrue($constraint->evaluate(new Exception, '', true));
1123 $this->assertEquals('is not instance of class "stdClass"', $constraint->toString());
1124 $this->assertCount(1, $constraint);
1127 $constraint->evaluate(new stdClass);
1146 $constraint = PHPUnit_Framework_Assert::logicalNot(
1151 $constraint->evaluate(new stdClass, 'custom message');
1170 $constraint = PHPUnit_Framework_Assert::isType('string');
1172 $this->assertFalse($constraint->evaluate(0, '', true));
1173 $this->assertTrue($constraint->evaluate('', '', true));
1174 $this->assertEquals('is of type "string"', $constraint->toString());
1175 $this->assertCount(1, $constraint);
1178 $constraint->evaluate(new stdClass);
1196 $constraint = PHPUnit_Framework_Assert::isType('string');
1199 $constraint->evaluate(new stdClass, 'custom message');
1232 $constraint = PHPUnit_Framework_Assert::isType('resource');
1234 $this->assertTrue($constraint->evaluate($resource, '', true));
1241 $constraint = PHPUnit_Framework_Assert::logicalNot(
1245 $this->assertTrue($constraint->evaluate(0, '', true));
1246 $this->assertFalse($constraint->evaluate('', '', true));
1247 $this->assertEquals('is not of type "string"', $constraint->toString());
1248 $this->assertCount(1, $constraint);
1251 $constraint->evaluate('');
1270 $constraint = PHPUnit_Framework_Assert::logicalNot(
1275 $constraint->evaluate('', 'custom message');
1294 $constraint = PHPUnit_Framework_Assert::isNull();
1296 $this->assertFalse($constraint->evaluate(0, '', true));
1297 $this->assertTrue($constraint->evaluate(null, '', true));
1298 $this->assertEquals('is null', $constraint->toString());
1299 $this->assertCount(1, $constraint);
1302 $constraint->evaluate(0);
1320 $constraint = PHPUnit_Framework_Assert::isNull();
1323 $constraint->evaluate(0, 'custom message');
1342 $constraint = PHPUnit_Framework_Assert::logicalNot(
1346 $this->assertFalse($constraint->evaluate(null, '', true));
1347 $this->assertTrue($constraint->evaluate(0, '', true));
1348 $this->assertEquals('is not null', $constraint->toString());
1349 $this->assertCount(1, $constraint);
1352 $constraint->evaluate(null);
1370 $constraint = PHPUnit_Framework_Assert::logicalNot(
1375 $constraint->evaluate(null, 'custom message');
1394 $constraint = PHPUnit_Framework_Assert::lessThan(1);
1396 $this->assertTrue($constraint->evaluate(0, '', true));
1397 $this->assertFalse($constraint->evaluate(1, '', true));
1398 $this->assertEquals('is less than 1', $constraint->toString());
1399 $this->assertCount(1, $constraint);
1402 $constraint->evaluate(1);
1421 $constraint = PHPUnit_Framework_Assert::lessThan(1);
1424 $constraint->evaluate(1, 'custom message');
1444 $constraint = PHPUnit_Framework_Assert::logicalNot(
1448 $this->assertTrue($constraint->evaluate(1, '', true));
1449 $this->assertFalse($constraint->evaluate(0, '', true));
1450 $this->assertEquals('is not less than 1', $constraint->toString());
1451 $this->assertCount(1, $constraint);
1454 $constraint->evaluate(0);
1473 $constraint = PHPUnit_Framework_Assert::logicalNot(
1478 $constraint->evaluate(0, 'custom message');
1498 $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1);
1500 $this->assertTrue($constraint->evaluate(1, '', true));
1501 $this->assertFalse($constraint->evaluate(2, '', true));
1502 $this->assertEquals('is equal to 1 or is less than 1', $constraint->toString());
1503 $this->assertCount(2, $constraint);
1506 $constraint->evaluate(2);
1533 $constraint = PHPUnit_Framework_Assert::callback($closureWithoutParameter);
1534 $this->assertTrue($constraint->evaluate('', '', true));
1536 $constraint = PHPUnit_Framework_Assert::callback($closureReflect);
1537 $this->assertTrue($constraint->evaluate(true, '', true));
1538 $this->assertFalse($constraint->evaluate(false, '', true));
1541 $constraint = PHPUnit_Framework_Assert::callback($callback);
1542 $this->assertTrue($constraint->evaluate(false, '', true));
1545 $constraint = PHPUnit_Framework_Assert::callback($callback);
1546 $this->assertTrue($constraint->evaluate(null, '', true));
1548 $this->assertEquals('is accepted by specified callback', $constraint->toString());
1557 $constraint = PHPUnit_Framework_Assert::callback(function () {
1560 $constraint->evaluate('This fails');
1575 $constraint = PHPUnit_Framework_Assert::lessThanOrEqual(1);
1578 $constraint->evaluate(2, 'custom message');
1598 $constraint = PHPUnit_Framework_Assert::logicalNot(
1602 $this->assertTrue($constraint->evaluate(2, '', true));
1603 $this->assertFalse($constraint->evaluate(1, '', true));
1604 $this->assertEquals('not( is equal to 1 or is less than 1 )', $constraint->toString());
1605 $this->assertCount(2, $constraint);
1608 $constraint->evaluate(1);
1627 $constraint = PHPUnit_Framework_Assert::logicalNot(
1632 $constraint->evaluate(1, 'custom message');
1652 $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute');
1654 $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', true));
1655 $this->assertFalse($constraint->evaluate('stdClass', '', true));
1656 $this->assertEquals('has attribute "privateAttribute"', $constraint->toString());
1657 $this->assertCount(1, $constraint);
1660 $constraint->evaluate('stdClass');
1679 $constraint = PHPUnit_Framework_Assert::classHasAttribute('privateAttribute');
1682 $constraint->evaluate('stdClass', 'custom message');
1701 $constraint = PHPUnit_Framework_Assert::logicalNot(
1705 $this->assertTrue($constraint->evaluate('stdClass', '', true));
1706 $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', true));
1707 $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString());
1708 $this->assertCount(1, $constraint);
1711 $constraint->evaluate('ClassWithNonPublicAttributes');
1730 $constraint = PHPUnit_Framework_Assert::logicalNot(
1735 $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message');
1754 $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('privateStaticAttribute');
1756 $this->assertTrue($constraint->evaluate('ClassWithNonPublicAttributes', '', true));
1757 $this->assertFalse($constraint->evaluate('stdClass', '', true));
1758 … $this->assertEquals('has static attribute "privateStaticAttribute"', $constraint->toString());
1759 $this->assertCount(1, $constraint);
1762 $constraint->evaluate('stdClass');
1781 $constraint = PHPUnit_Framework_Assert::classHasStaticAttribute('foo');
1784 $constraint->evaluate('stdClass', 'custom message');
1803 $constraint = PHPUnit_Framework_Assert::logicalNot(
1807 $this->assertTrue($constraint->evaluate('stdClass', '', true));
1808 $this->assertFalse($constraint->evaluate('ClassWithNonPublicAttributes', '', true));
1809 …$this->assertEquals('does not have static attribute "privateStaticAttribute"', $constraint->toStri…
1810 $this->assertCount(1, $constraint);
1813 $constraint->evaluate('ClassWithNonPublicAttributes');
1832 $constraint = PHPUnit_Framework_Assert::logicalNot(
1837 $constraint->evaluate('ClassWithNonPublicAttributes', 'custom message');
1856 $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute');
1858 $this->assertTrue($constraint->evaluate(new ClassWithNonPublicAttributes, '', true));
1859 $this->assertFalse($constraint->evaluate(new stdClass, '', true));
1860 $this->assertEquals('has attribute "privateAttribute"', $constraint->toString());
1861 $this->assertCount(1, $constraint);
1864 $constraint->evaluate(new stdClass);
1883 $constraint = PHPUnit_Framework_Assert::objectHasAttribute('privateAttribute');
1886 $constraint->evaluate(new stdClass, 'custom message');
1905 $constraint = PHPUnit_Framework_Assert::logicalNot(
1909 $this->assertTrue($constraint->evaluate(new stdClass, '', true));
1910 $this->assertFalse($constraint->evaluate(new ClassWithNonPublicAttributes, '', true));
1911 $this->assertEquals('does not have attribute "privateAttribute"', $constraint->toString());
1912 $this->assertCount(1, $constraint);
1915 $constraint->evaluate(new ClassWithNonPublicAttributes);
1934 $constraint = PHPUnit_Framework_Assert::logicalNot(
1939 $constraint->evaluate(new ClassWithNonPublicAttributes, 'custom message');
1958 $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/');
1960 $this->assertFalse($constraint->evaluate('barbazbar', '', true));
1961 $this->assertTrue($constraint->evaluate('barfoobar', '', true));
1962 $this->assertEquals('matches PCRE pattern "/foo/"', $constraint->toString());
1963 $this->assertCount(1, $constraint);
1966 $constraint->evaluate('barbazbar');
1985 $constraint = PHPUnit_Framework_Assert::matchesRegularExpression('/foo/');
1988 $constraint->evaluate('barbazbar', 'custom message');
2007 $constraint = PHPUnit_Framework_Assert::logicalNot(
2011 $this->assertTrue($constraint->evaluate('barbazbar', '', true));
2012 $this->assertFalse($constraint->evaluate('barfoobar', '', true));
2013 $this->assertEquals('does not match PCRE pattern "/foo/"', $constraint->toString());
2014 $this->assertCount(1, $constraint);
2017 $constraint->evaluate('barfoobar');
2036 $constraint = PHPUnit_Framework_Assert::logicalNot(
2041 $constraint->evaluate('barfoobar', 'custom message');
2060 $constraint = PHPUnit_Framework_Assert::matches('*%c*');
2061 $this->assertFalse($constraint->evaluate('**', '', true));
2062 $this->assertTrue($constraint->evaluate('***', '', true));
2063 $this->assertEquals('matches PCRE pattern "/^\*.\*$/s"', $constraint->toString());
2064 $this->assertCount(1, $constraint);
2069 $constraint = PHPUnit_Framework_Assert::matches('*%s*');
2070 $this->assertFalse($constraint->evaluate('**', '', true));
2071 $this->assertTrue($constraint->evaluate('***', '', true));
2072 $this->assertEquals('matches PCRE pattern "/^\*[^\r\n]+\*$/s"', $constraint->toString());
2073 $this->assertCount(1, $constraint);
2078 $constraint = PHPUnit_Framework_Assert::matches('*%i*');
2079 $this->assertFalse($constraint->evaluate('**', '', true));
2080 $this->assertTrue($constraint->evaluate('*0*', '', true));
2081 $this->assertEquals('matches PCRE pattern "/^\*[+-]?\d+\*$/s"', $constraint->toString());
2082 $this->assertCount(1, $constraint);
2087 $constraint = PHPUnit_Framework_Assert::matches('*%d*');
2088 $this->assertFalse($constraint->evaluate('**', '', true));
2089 $this->assertTrue($constraint->evaluate('*0*', '', true));
2090 $this->assertEquals('matches PCRE pattern "/^\*\d+\*$/s"', $constraint->toString());
2091 $this->assertCount(1, $constraint);
2096 $constraint = PHPUnit_Framework_Assert::matches('*%x*');
2097 $this->assertFalse($constraint->evaluate('**', '', true));
2098 $this->assertTrue($constraint->evaluate('*0f0f0f*', '', true));
2099 … $this->assertEquals('matches PCRE pattern "/^\*[0-9a-fA-F]+\*$/s"', $constraint->toString());
2100 $this->assertCount(1, $constraint);
2105 $constraint = PHPUnit_Framework_Assert::matches('*%f*');
2106 $this->assertFalse($constraint->evaluate('**', '', true));
2107 $this->assertTrue($constraint->evaluate('*1.0*', '', true));
2108 …als('matches PCRE pattern "/^\*[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?\*$/s"', $constraint->toString());
2109 $this->assertCount(1, $constraint);
2114 $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix');
2116 $this->assertFalse($constraint->evaluate('foo', '', true));
2117 $this->assertTrue($constraint->evaluate('prefixfoo', '', true));
2118 $this->assertEquals('starts with "prefix"', $constraint->toString());
2119 $this->assertCount(1, $constraint);
2122 $constraint->evaluate('foo');
2141 $constraint = PHPUnit_Framework_Assert::stringStartsWith('prefix');
2144 $constraint->evaluate('foo', 'custom message');
2163 $constraint = PHPUnit_Framework_Assert::logicalNot(
2167 $this->assertTrue($constraint->evaluate('foo', '', true));
2168 $this->assertFalse($constraint->evaluate('prefixfoo', '', true));
2169 $this->assertEquals('starts not with "prefix"', $constraint->toString());
2170 $this->assertCount(1, $constraint);
2173 $constraint->evaluate('prefixfoo');
2192 $constraint = PHPUnit_Framework_Assert::logicalNot(
2197 $constraint->evaluate('prefixfoo', 'custom message');
2217 $constraint = PHPUnit_Framework_Assert::stringContains('foo');
2219 $this->assertFalse($constraint->evaluate('barbazbar', '', true));
2220 $this->assertTrue($constraint->evaluate('barfoobar', '', true));
2221 $this->assertEquals('contains "foo"', $constraint->toString());
2222 $this->assertCount(1, $constraint);
2225 $constraint->evaluate('barbazbar');
2244 $constraint = PHPUnit_Framework_Assert::stringContains('oryginał', true);
2246 $this->assertFalse($constraint->evaluate('oryginal', '', true));
2247 $this->assertTrue($constraint->evaluate('ORYGINAŁ', '', true));
2248 $this->assertTrue($constraint->evaluate('oryginał', '', true));
2249 $this->assertEquals('contains "oryginał"', $constraint->toString());
2250 $this->assertEquals(1, count($constraint));
2253 $constraint->evaluate('oryginal');
2272 $constraint = PHPUnit_Framework_Assert::stringContains('oryginał', false);
2274 $this->assertFalse($constraint->evaluate('oryginal', '', true));
2275 $this->assertFalse($constraint->evaluate('ORYGINAŁ', '', true));
2276 $this->assertTrue($constraint->evaluate('oryginał', '', true));
2277 $this->assertEquals('contains "oryginał"', $constraint->toString());
2278 $this->assertEquals(1, count($constraint));
2281 $constraint->evaluate('oryginal');
2300 $constraint = PHPUnit_Framework_Assert::stringContains('foo');
2303 $constraint->evaluate('barbazbar', 'custom message');
2323 $constraint = PHPUnit_Framework_Assert::logicalNot(
2327 $this->assertTrue($constraint->evaluate('barbazbar', '', true));
2328 $this->assertFalse($constraint->evaluate('barfoobar', '', true));
2329 $this->assertEquals('does not contain "foo"', $constraint->toString());
2330 $this->assertCount(1, $constraint);
2333 $constraint->evaluate('barfoobar');
2352 $constraint = PHPUnit_Framework_Assert::logicalNot(
2356 $this->assertTrue($constraint->evaluate('original', '', true));
2357 $this->assertFalse($constraint->evaluate('ORYGINAŁ', '', true));
2358 $this->assertFalse($constraint->evaluate('oryginał', '', true));
2359 $this->assertEquals('does not contain "oryginał"', $constraint->toString());
2360 $this->assertEquals(1, count($constraint));
2363 $constraint->evaluate('ORYGINAŁ');
2382 $constraint = PHPUnit_Framework_Assert::logicalNot(
2386 $this->assertTrue($constraint->evaluate('original', '', true));
2387 $this->assertTrue($constraint->evaluate('ORYGINAŁ', '', true));
2388 $this->assertFalse($constraint->evaluate('oryginał', '', true));
2389 $this->assertEquals('does not contain "oryginał"', $constraint->toString());
2390 $this->assertEquals(1, count($constraint));
2393 $constraint->evaluate('oryginał');
2412 $constraint = PHPUnit_Framework_Assert::logicalNot(
2417 $constraint->evaluate('barfoobar', 'custom message');
2437 $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix');
2439 $this->assertFalse($constraint->evaluate('foo', '', true));
2440 $this->assertTrue($constraint->evaluate('foosuffix', '', true));
2441 $this->assertEquals('ends with "suffix"', $constraint->toString());
2442 $this->assertCount(1, $constraint);
2445 $constraint->evaluate('foo');
2464 $constraint = PHPUnit_Framework_Assert::stringEndsWith('suffix');
2467 $constraint->evaluate('foo', 'custom message');
2487 $constraint = PHPUnit_Framework_Assert::logicalNot(
2491 $this->assertTrue($constraint->evaluate('foo', '', true));
2492 $this->assertFalse($constraint->evaluate('foosuffix', '', true));
2493 $this->assertEquals('ends not with "suffix"', $constraint->toString());
2494 $this->assertCount(1, $constraint);
2497 $constraint->evaluate('foosuffix');
2516 $constraint = PHPUnit_Framework_Assert::logicalNot(
2521 $constraint->evaluate('foosuffix', 'custom message');
2542 $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo', true, true);
2544 $this->assertFalse($constraint->evaluate([0], '', true));
2545 $this->assertFalse($constraint->evaluate([true], '', true));
2548 $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo');
2550 $this->assertTrue($constraint->evaluate([0], '', true));
2551 $this->assertTrue($constraint->evaluate([true], '', true));
2556 $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo');
2558 $this->assertFalse($constraint->evaluate(['bar'], '', true));
2559 $this->assertTrue($constraint->evaluate(['foo'], '', true));
2560 $this->assertEquals("contains 'foo'", $constraint->toString());
2561 $this->assertCount(1, $constraint);
2564 $constraint->evaluate(['bar']);
2583 $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo');
2586 $constraint->evaluate(['bar'], 'custom message');
2606 $constraint = PHPUnit_Framework_Assert::logicalNot(
2610 $this->assertTrue($constraint->evaluate(['bar'], '', true));
2611 $this->assertFalse($constraint->evaluate(['foo'], '', true));
2612 $this->assertEquals("does not contain 'foo'", $constraint->toString());
2613 $this->assertCount(1, $constraint);
2616 $constraint->evaluate(['foo']);
2635 $constraint = PHPUnit_Framework_Assert::logicalNot(
2640 $constraint->evaluate(['foo'], 'custom message');
2661 $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object);
2662 … $this->assertStringMatchesFormat('contains stdClass Object &%s ()', $constraint->toString());
2665 $this->assertFalse($constraint->evaluate($storage, '', true));
2668 $this->assertTrue($constraint->evaluate($storage, '', true));
2671 $constraint->evaluate(new SplObjectStorage);
2691 $constraint = new PHPUnit_Framework_Constraint_TraversableContains($object);
2694 $constraint->evaluate(new SplObjectStorage, 'custom message');
2715 $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 1);
2717 $this->assertTrue($constraint->evaluate($object, '', true));
2718 $this->assertEquals('attribute "foo" is equal to 1', $constraint->toString());
2719 $this->assertCount(1, $constraint);
2721 $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2);
2723 $this->assertFalse($constraint->evaluate($object, '', true));
2726 $constraint->evaluate($object);
2746 $constraint = PHPUnit_Framework_Assert::attributeEqualTo('foo', 2);
2749 $constraint->evaluate($object, 'custom message');
2769 $constraint = PHPUnit_Framework_Assert::logicalNot(
2773 $this->assertTrue($constraint->evaluate($object, '', true));
2774 $this->assertEquals('attribute "foo" is not equal to 2', $constraint->toString());
2775 $this->assertCount(1, $constraint);
2777 $constraint = PHPUnit_Framework_Assert::logicalNot(
2781 $this->assertFalse($constraint->evaluate($object, '', true));
2784 $constraint->evaluate($object);
2804 $constraint = PHPUnit_Framework_Assert::logicalNot(
2809 $constraint->evaluate($object, 'custom message');
2828 $constraint = new PHPUnit_Framework_Constraint_IsEmpty;
2830 $this->assertFalse($constraint->evaluate(['foo'], '', true));
2831 $this->assertTrue($constraint->evaluate([], '', true));
2832 $this->assertFalse($constraint->evaluate(new ArrayObject(['foo']), '', true));
2833 $this->assertTrue($constraint->evaluate(new ArrayObject([]), '', true));
2834 $this->assertEquals('is empty', $constraint->toString());
2835 $this->assertCount(1, $constraint);
2838 $constraint->evaluate(['foo']);
2857 $constraint = new PHPUnit_Framework_Constraint_IsEmpty;
2860 $constraint->evaluate(['foo'], 'custom message');
2879 $constraint = new PHPUnit_Framework_Constraint_Count(5);
2881 $this->assertTrue($constraint->evaluate([1, 2, 3, 4, 5], '', true));
2882 $this->assertFalse($constraint->evaluate([1, 2, 3, 4], '', true));
2887 $constraint = new PHPUnit_Framework_Constraint_Count(5);
2889 $this->assertTrue($constraint->evaluate(new TestIterator([1, 2, 3, 4, 5]), '', true));
2890 $this->assertFalse($constraint->evaluate(new TestIterator([1, 2, 3, 4]), '', true));
2895 $constraint = new PHPUnit_Framework_Constraint_Count(5);
2897 $this->assertTrue($constraint->evaluate(new ArrayObject([1, 2, 3, 4, 5]), '', true));
2898 $this->assertFalse($constraint->evaluate(new ArrayObject([1, 2, 3, 4]), '', true));
2903 $constraint = new PHPUnit_Framework_Constraint_Count(5);
2906 $constraint->evaluate([1, 2]);
2925 $constraint = PHPUnit_Framework_Assert::logicalNot(
2930 $constraint->evaluate([1, 2]);
2949 $constraint = new PHPUnit_Framework_Constraint_SameSize([1, 2, 3, 4, 5]);
2951 $this->assertTrue($constraint->evaluate([6, 7, 8, 9, 10], '', true));
2952 $this->assertFalse($constraint->evaluate([1, 2, 3, 4], '', true));
2957 $constraint = new PHPUnit_Framework_Constraint_SameSize(new TestIterator([1, 2, 3, 4, 5]));
2959 $this->assertTrue($constraint->evaluate(new TestIterator([6, 7, 8, 9, 10]), '', true));
2960 $this->assertFalse($constraint->evaluate(new TestIterator([1, 2, 3, 4]), '', true));
2965 $constraint = new PHPUnit_Framework_Constraint_SameSize(new ArrayObject([1, 2, 3, 4, 5]));
2967 $this->assertTrue($constraint->evaluate(new ArrayObject([6, 7, 8, 9, 10]), '', true));
2968 $this->assertFalse($constraint->evaluate(new ArrayObject([1, 2, 3, 4]), '', true));
2973 $constraint = new PHPUnit_Framework_Constraint_SameSize([1, 2, 3, 4, 5]);
2976 $constraint->evaluate([1, 2]);
2995 $constraint = PHPUnit_Framework_Assert::logicalNot(
3000 $constraint->evaluate([3, 4]);
3019 $constraint = new PHPUnit_Framework_Constraint_Exception('FoobarException');
3024 $constraint->evaluate($exception);