5 * Copyright (c) 2002-2011, Sebastian Bergmann <sebastian@phpunit.de>.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
20 * * Neither the name of Sebastian Bergmann nor the names of his
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
38 * @subpackage Framework
39 * @author Sebastian Bergmann <sebastian@phpunit.de>
40 * @copyright 2002-2011 Sebastian Bergmann <sebastian@phpunit.de>
41 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
42 * @link http://www.phpunit.de/
43 * @since File available since Release 3.5.0
47 * Returns a matcher that matches when the method it is evaluated for
48 * is executed zero or more times.
50 * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
51 * @since Method available since Release 3.0.0
55 return PHPUnit_Framework_TestCase::any();
59 * Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
61 * @return PHPUnit_Framework_Constraint_IsAnything
62 * @since Method available since Release 3.0.0
66 return PHPUnit_Framework_Assert::anything();
70 * Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
73 * @return PHPUnit_Framework_Constraint_ArrayHasKey
74 * @since Method available since Release 3.0.0
76 function arrayHasKey($key)
78 return PHPUnit_Framework_Assert::arrayHasKey($key);
82 * Asserts that an array has a specified key.
86 * @param string $message
87 * @since Method available since Release 3.0.0
89 function assertArrayHasKey($key, array $array, $message = '')
91 return PHPUnit_Framework_Assert::assertArrayHasKey($key, $array, $message);
95 * Asserts that an array does not have a specified key.
99 * @param string $message
100 * @since Method available since Release 3.0.0
102 function assertArrayNotHasKey($key, array $array, $message = '')
104 return PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $array, $message);
108 * Asserts that a haystack that is stored in a static attribute of a class
109 * or an attribute of an object contains a needle.
111 * @param mixed $needle
112 * @param string $haystackAttributeName
113 * @param mixed $haystackClassOrObject
114 * @param string $message
115 * @param boolean $ignoreCase
116 * @since Method available since Release 3.0.0
118 function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE)
120 return PHPUnit_Framework_Assert::assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message, $ignoreCase);
124 * Asserts that a haystack that is stored in a static attribute of a class
125 * or an attribute of an object contains only values of a given type.
127 * @param string $type
128 * @param string $haystackAttributeName
129 * @param mixed $haystackClassOrObject
130 * @param boolean $isNativeType
131 * @param string $message
132 * @since Method available since Release 3.1.4
134 function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '')
136 return PHPUnit_Framework_Assert::assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType, $message);
140 * Asserts that a static attribute of a class or an attribute of an object
143 * @param string $haystackAttributeName
144 * @param mixed $haystackClassOrObject
145 * @param string $message
146 * @since Method available since Release 3.5.0
148 function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
150 return PHPUnit_Framework_Assert::assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message);
154 * Asserts that a variable is equal to an attribute of an object.
156 * @param mixed $expected
157 * @param string $actualAttributeName
158 * @param string $actualClassOrObject
159 * @param string $message
160 * @param float $delta
161 * @param integer $maxDepth
162 * @param boolean $canonicalize
163 * @param boolean $ignoreCase
165 function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
167 return PHPUnit_Framework_Assert::assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
171 * Asserts that an attribute is greater than another value.
173 * @param mixed $expected
174 * @param string $actualAttributeName
175 * @param string $actualClassOrObject
176 * @param string $message
177 * @since Method available since Release 3.1.0
179 function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
181 return PHPUnit_Framework_Assert::assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message);
185 * Asserts that an attribute is greater than or equal to another value.
187 * @param mixed $expected
188 * @param string $actualAttributeName
189 * @param string $actualClassOrObject
190 * @param string $message
191 * @since Method available since Release 3.1.0
193 function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
195 return PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message);
199 * Asserts that an attribute is of a given type.
201 * @param string $expected
202 * @param string $attributeName
203 * @param mixed $classOrObject
204 * @param string $message
205 * @since Method available since Release 3.5.0
207 function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')
209 return PHPUnit_Framework_Assert::assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message);
213 * Asserts that an attribute is of a given type.
215 * @param string $expected
216 * @param string $attributeName
217 * @param mixed $classOrObject
218 * @param string $message
219 * @since Method available since Release 3.5.0
221 function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '')
223 return PHPUnit_Framework_Assert::assertAttributeInternalType($expected, $attributeName, $classOrObject, $message);
227 * Asserts that an attribute is smaller than another value.
229 * @param mixed $expected
230 * @param string $actualAttributeName
231 * @param string $actualClassOrObject
232 * @param string $message
233 * @since Method available since Release 3.1.0
235 function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
237 return PHPUnit_Framework_Assert::assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message);
241 * Asserts that an attribute is smaller than or equal to another value.
243 * @param mixed $expected
244 * @param string $actualAttributeName
245 * @param string $actualClassOrObject
246 * @param string $message
247 * @since Method available since Release 3.1.0
249 function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
251 return PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message);
255 * Asserts that a haystack that is stored in a static attribute of a class
256 * or an attribute of an object does not contain a needle.
258 * @param mixed $needle
259 * @param string $haystackAttributeName
260 * @param mixed $haystackClassOrObject
261 * @param string $message
262 * @param boolean $ignoreCase
263 * @since Method available since Release 3.0.0
265 function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE)
267 return PHPUnit_Framework_Assert::assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message, $ignoreCase);
271 * Asserts that a haystack that is stored in a static attribute of a class
272 * or an attribute of an object does not contain only values of a given
275 * @param string $type
276 * @param string $haystackAttributeName
277 * @param mixed $haystackClassOrObject
278 * @param boolean $isNativeType
279 * @param string $message
280 * @since Method available since Release 3.1.4
282 function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '')
284 return PHPUnit_Framework_Assert::assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType, $message);
288 * Asserts that a static attribute of a class or an attribute of an object
291 * @param string $haystackAttributeName
292 * @param mixed $haystackClassOrObject
293 * @param string $message
294 * @since Method available since Release 3.5.0
296 function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
298 return PHPUnit_Framework_Assert::assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message);
302 * Asserts that a variable is not equal to an attribute of an object.
304 * @param mixed $expected
305 * @param string $actualAttributeName
306 * @param string $actualClassOrObject
307 * @param string $message
308 * @param float $delta
309 * @param integer $maxDepth
310 * @param boolean $canonicalize
311 * @param boolean $ignoreCase
313 function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
315 return PHPUnit_Framework_Assert::assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
319 * Asserts that an attribute is of a given type.
321 * @param string $expected
322 * @param string $attributeName
323 * @param mixed $classOrObject
324 * @param string $message
325 * @since Method available since Release 3.5.0
327 function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '')
329 return PHPUnit_Framework_Assert::assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message);
333 * Asserts that an attribute is of a given type.
335 * @param string $expected
336 * @param string $attributeName
337 * @param mixed $classOrObject
338 * @param string $message
339 * @since Method available since Release 3.5.0
341 function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '')
343 return PHPUnit_Framework_Assert::assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message);
347 * Asserts that a variable and an attribute of an object do not have the
348 * same type and value.
350 * @param mixed $expected
351 * @param string $actualAttributeName
352 * @param object $actualClassOrObject
353 * @param string $message
355 function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
357 return PHPUnit_Framework_Assert::assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message);
361 * Asserts that an attribute is of a given type.
363 * @param string $expected
364 * @param string $attributeName
365 * @param mixed $classOrObject
366 * @param string $message
367 * @since Method available since Release 3.4.0
369 function assertAttributeNotType($expected, $attributeName, $classOrObject, $message = '')
371 return PHPUnit_Framework_Assert::assertAttributeNotType($expected, $attributeName, $classOrObject, $message);
375 * Asserts that a variable and an attribute of an object have the same type
378 * @param mixed $expected
379 * @param string $actualAttributeName
380 * @param object $actualClassOrObject
381 * @param string $message
383 function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
385 return PHPUnit_Framework_Assert::assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message);
389 * Asserts that an attribute is of a given type.
391 * @param string $expected
392 * @param string $attributeName
393 * @param mixed $classOrObject
394 * @param string $message
395 * @since Method available since Release 3.4.0
397 function assertAttributeType($expected, $attributeName, $classOrObject, $message = '')
399 return PHPUnit_Framework_Assert::assertAttributeType($expected, $attributeName, $classOrObject, $message);
403 * Asserts that a class has a specified attribute.
405 * @param string $attributeName
406 * @param string $className
407 * @param string $message
408 * @since Method available since Release 3.1.0
410 function assertClassHasAttribute($attributeName, $className, $message = '')
412 return PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $className, $message);
416 * Asserts that a class has a specified static attribute.
418 * @param string $attributeName
419 * @param string $className
420 * @param string $message
421 * @since Method available since Release 3.1.0
423 function assertClassHasStaticAttribute($attributeName, $className, $message = '')
425 return PHPUnit_Framework_Assert::assertClassHasStaticAttribute($attributeName, $className, $message);
429 * Asserts that a class does not have a specified attribute.
431 * @param string $attributeName
432 * @param string $className
433 * @param string $message
434 * @since Method available since Release 3.1.0
436 function assertClassNotHasAttribute($attributeName, $className, $message = '')
438 return PHPUnit_Framework_Assert::assertClassNotHasAttribute($attributeName, $className, $message);
442 * Asserts that a class does not have a specified static attribute.
444 * @param string $attributeName
445 * @param string $className
446 * @param string $message
447 * @since Method available since Release 3.1.0
449 function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
451 return PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute($attributeName, $className, $message);
455 * Asserts that a haystack contains a needle.
457 * @param mixed $needle
458 * @param mixed $haystack
459 * @param string $message
460 * @param boolean $ignoreCase
461 * @since Method available since Release 2.1.0
463 function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
465 return PHPUnit_Framework_Assert::assertContains($needle, $haystack, $message, $ignoreCase);
469 * Asserts that a haystack contains only values of a given type.
471 * @param string $type
472 * @param mixed $haystack
473 * @param boolean $isNativeType
474 * @param string $message
475 * @since Method available since Release 3.1.4
477 function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
479 return PHPUnit_Framework_Assert::assertContainsOnly($type, $haystack, $isNativeType, $message);
483 * Asserts that a variable is empty.
485 * @param mixed $actual
486 * @param string $message
487 * @throws PHPUnit_Framework_AssertionFailedError
489 function assertEmpty($actual, $message = '')
491 return PHPUnit_Framework_Assert::assertEmpty($actual, $message);
495 * Asserts that a hierarchy of DOMNodes matches.
497 * @param DOMNode $expectedNode
498 * @param DOMNode $actualNode
499 * @param boolean $checkAttributes
500 * @param string $message
501 * @author Mattis Stordalen Flister <mattis@xait.no>
502 * @since Method available since Release 3.3.0
504 function assertEqualXMLStructure(DOMNode $expectedNode, DOMNode $actualNode, $checkAttributes = FALSE, $message = '')
506 return PHPUnit_Framework_Assert::assertEqualXMLStructure($expectedNode, $actualNode, $checkAttributes, $message);
510 * Asserts that two variables are equal.
512 * @param mixed $expected
513 * @param mixed $actual
514 * @param string $message
515 * @param float $delta
516 * @param integer $maxDepth
517 * @param boolean $canonicalize
518 * @param boolean $ignoreCase
520 function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
522 return PHPUnit_Framework_Assert::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
526 * Asserts that a condition is false.
528 * @param boolean $condition
529 * @param string $message
530 * @throws PHPUnit_Framework_AssertionFailedError
532 function assertFalse($condition, $message = '')
534 return PHPUnit_Framework_Assert::assertFalse($condition, $message);
538 * Asserts that the contents of one file is equal to the contents of another
541 * @param string $expected
542 * @param string $actual
543 * @param string $message
544 * @param boolean $canonicalize
545 * @param boolean $ignoreCase
546 * @since Method available since Release 3.2.14
548 function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
550 return PHPUnit_Framework_Assert::assertFileEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
554 * Asserts that a file exists.
556 * @param string $filename
557 * @param string $message
558 * @since Method available since Release 3.0.0
560 function assertFileExists($filename, $message = '')
562 return PHPUnit_Framework_Assert::assertFileExists($filename, $message);
566 * Asserts that the contents of one file is not equal to the contents of
569 * @param string $expected
570 * @param string $actual
571 * @param string $message
572 * @param boolean $canonicalize
573 * @param boolean $ignoreCase
574 * @since Method available since Release 3.2.14
576 function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
578 return PHPUnit_Framework_Assert::assertFileNotEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
582 * Asserts that a file does not exist.
584 * @param string $filename
585 * @param string $message
586 * @since Method available since Release 3.0.0
588 function assertFileNotExists($filename, $message = '')
590 return PHPUnit_Framework_Assert::assertFileNotExists($filename, $message);
594 * Asserts that a value is greater than another value.
596 * @param mixed $expected
597 * @param mixed $actual
598 * @param string $message
599 * @since Method available since Release 3.1.0
601 function assertGreaterThan($expected, $actual, $message = '')
603 return PHPUnit_Framework_Assert::assertGreaterThan($expected, $actual, $message);
607 * Asserts that a value is greater than or equal to another value.
609 * @param mixed $expected
610 * @param mixed $actual
611 * @param string $message
612 * @since Method available since Release 3.1.0
614 function assertGreaterThanOrEqual($expected, $actual, $message = '')
616 return PHPUnit_Framework_Assert::assertGreaterThanOrEqual($expected, $actual, $message);
620 * Asserts that a variable is of a given type.
622 * @param string $expected
623 * @param mixed $actual
624 * @param string $message
625 * @since Method available since Release 3.5.0
627 function assertInstanceOf($expected, $actual, $message = '')
629 return PHPUnit_Framework_Assert::assertInstanceOf($expected, $actual, $message);
633 * Asserts that a variable is of a given type.
635 * @param string $expected
636 * @param mixed $actual
637 * @param string $message
638 * @since Method available since Release 3.5.0
640 function assertInternalType($expected, $actual, $message = '')
642 return PHPUnit_Framework_Assert::assertInternalType($expected, $actual, $message);
646 * Asserts that a value is smaller than another value.
648 * @param mixed $expected
649 * @param mixed $actual
650 * @param string $message
651 * @since Method available since Release 3.1.0
653 function assertLessThan($expected, $actual, $message = '')
655 return PHPUnit_Framework_Assert::assertLessThan($expected, $actual, $message);
659 * Asserts that a value is smaller than or equal to another value.
661 * @param mixed $expected
662 * @param mixed $actual
663 * @param string $message
664 * @since Method available since Release 3.1.0
666 function assertLessThanOrEqual($expected, $actual, $message = '')
668 return PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $message);
672 * Asserts that a haystack does not contain a needle.
674 * @param mixed $needle
675 * @param mixed $haystack
676 * @param string $message
677 * @param boolean $ignoreCase
678 * @since Method available since Release 2.1.0
680 function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
682 return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase);
686 * Asserts that a haystack does not contain only values of a given type.
688 * @param string $type
689 * @param mixed $haystack
690 * @param boolean $isNativeType
691 * @param string $message
692 * @since Method available since Release 3.1.4
694 function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
696 return PHPUnit_Framework_Assert::assertNotContainsOnly($type, $haystack, $isNativeType, $message);
700 * Asserts that a variable is not empty.
702 * @param mixed $actual
703 * @param string $message
704 * @throws PHPUnit_Framework_AssertionFailedError
706 function assertNotEmpty($actual, $message = '')
708 return PHPUnit_Framework_Assert::assertNotEmpty($actual, $message);
712 * Asserts that two variables are not equal.
714 * @param mixed $expected
715 * @param mixed $actual
716 * @param string $message
717 * @param float $delta
718 * @param integer $maxDepth
719 * @param boolean $canonicalize
720 * @param boolean $ignoreCase
721 * @since Method available since Release 2.3.0
723 function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
725 return PHPUnit_Framework_Assert::assertNotEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
729 * Asserts that a variable is not of a given type.
731 * @param string $expected
732 * @param mixed $actual
733 * @param string $message
734 * @since Method available since Release 3.5.0
736 function assertNotInstanceOf($expected, $actual, $message = '')
738 return PHPUnit_Framework_Assert::assertNotInstanceOf($expected, $actual, $message);
742 * Asserts that a variable is not of a given type.
744 * @param string $expected
745 * @param mixed $actual
746 * @param string $message
747 * @since Method available since Release 3.5.0
749 function assertNotInternalType($expected, $actual, $message = '')
751 return PHPUnit_Framework_Assert::assertNotInternalType($expected, $actual, $message);
755 * Asserts that a variable is not NULL.
757 * @param mixed $actual
758 * @param string $message
760 function assertNotNull($actual, $message = '')
762 return PHPUnit_Framework_Assert::assertNotNull($actual, $message);
766 * Asserts that a string does not match a given regular expression.
768 * @param string $pattern
769 * @param string $string
770 * @param string $message
771 * @since Method available since Release 2.1.0
773 function assertNotRegExp($pattern, $string, $message = '')
775 return PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
779 * Asserts that two variables do not have the same type and value.
780 * Used on objects, it asserts that two variables do not reference
783 * @param mixed $expected
784 * @param mixed $actual
785 * @param string $message
787 function assertNotSame($expected, $actual, $message = '')
789 return PHPUnit_Framework_Assert::assertNotSame($expected, $actual, $message);
793 * This assertion is the exact opposite of assertTag().
795 * Rather than asserting that $matcher results in a match, it asserts that
796 * $matcher does not match.
798 * @param array $matcher
799 * @param string $actual
800 * @param string $message
801 * @param boolean $isHtml
802 * @since Method available since Release 3.3.0
803 * @author Mike Naberezny <mike@maintainable.com>
804 * @author Derek DeVries <derek@maintainable.com>
806 function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE)
808 return PHPUnit_Framework_Assert::assertNotTag($matcher, $actual, $message, $isHtml);
812 * Asserts that a variable is not of a given type.
814 * @param string $expected
815 * @param mixed $actual
816 * @param string $message
817 * @since Method available since Release 2.2.0
819 function assertNotType($expected, $actual, $message = '')
821 return PHPUnit_Framework_Assert::assertNotType($expected, $actual, $message);
825 * Asserts that a variable is NULL.
827 * @param mixed $actual
828 * @param string $message
830 function assertNull($actual, $message = '')
832 return PHPUnit_Framework_Assert::assertNull($actual, $message);
836 * Asserts that an object has a specified attribute.
838 * @param string $attributeName
839 * @param object $object
840 * @param string $message
841 * @since Method available since Release 3.0.0
843 function assertObjectHasAttribute($attributeName, $object, $message = '')
845 return PHPUnit_Framework_Assert::assertObjectHasAttribute($attributeName, $object, $message);
849 * Asserts that an object does not have a specified attribute.
851 * @param string $attributeName
852 * @param object $object
853 * @param string $message
854 * @since Method available since Release 3.0.0
856 function assertObjectNotHasAttribute($attributeName, $object, $message = '')
858 return PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $object, $message);
862 * Asserts that a string matches a given regular expression.
864 * @param string $pattern
865 * @param string $string
866 * @param string $message
868 function assertRegExp($pattern, $string, $message = '')
870 return PHPUnit_Framework_Assert::assertRegExp($pattern, $string, $message);
874 * Asserts that two variables have the same type and value.
875 * Used on objects, it asserts that two variables reference
878 * @param mixed $expected
879 * @param mixed $actual
880 * @param string $message
882 function assertSame($expected, $actual, $message = '')
884 return PHPUnit_Framework_Assert::assertSame($expected, $actual, $message);
888 * Assert the presence, absence, or count of elements in a document matching
889 * the CSS $selector, regardless of the contents of those elements.
891 * The first argument, $selector, is the CSS selector used to match
892 * the elements in the $actual document.
894 * The second argument, $count, can be either boolean or numeric.
895 * When boolean, it asserts for presence of elements matching the selector
896 * (TRUE) or absence of elements (FALSE).
897 * When numeric, it asserts the count of elements.
899 * assertSelectCount("#binder", true, $xml); // any?
900 * assertSelectCount(".binder", 3, $xml); // exactly 3?
902 * @param array $selector
903 * @param integer $count
904 * @param mixed $actual
905 * @param string $message
906 * @param boolean $isHtml
907 * @since Method available since Release 3.3.0
908 * @author Mike Naberezny <mike@maintainable.com>
909 * @author Derek DeVries <derek@maintainable.com>
911 function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE)
913 return PHPUnit_Framework_Assert::assertSelectCount($selector, $count, $actual, $message, $isHtml);
917 * assertSelectEquals("#binder .name", "Chuck", true, $xml); // any?
918 * assertSelectEquals("#binder .name", "Chuck", false, $xml); // none?
920 * @param array $selector
921 * @param string $content
922 * @param integer $count
923 * @param mixed $actual
924 * @param string $message
925 * @param boolean $isHtml
926 * @since Method available since Release 3.3.0
927 * @author Mike Naberezny <mike@maintainable.com>
928 * @author Derek DeVries <derek@maintainable.com>
930 function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE)
932 return PHPUnit_Framework_Assert::assertSelectEquals($selector, $content, $count, $actual, $message, $isHtml);
936 * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
937 * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
939 * @param array $selector
940 * @param string $pattern
941 * @param integer $count
942 * @param mixed $actual
943 * @param string $message
944 * @param boolean $isHtml
945 * @since Method available since Release 3.3.0
946 * @author Mike Naberezny <mike@maintainable.com>
947 * @author Derek DeVries <derek@maintainable.com>
949 function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE)
951 return PHPUnit_Framework_Assert::assertSelectRegExp($selector, $pattern, $count, $actual, $message, $isHtml);
955 * Asserts that a string ends not with a given prefix.
957 * @param string $suffix
958 * @param string $string
959 * @param string $message
960 * @since Method available since Release 3.4.0
962 function assertStringEndsNotWith($suffix, $string, $message = '')
964 return PHPUnit_Framework_Assert::assertStringEndsNotWith($suffix, $string, $message);
968 * Asserts that a string ends with a given prefix.
970 * @param string $suffix
971 * @param string $string
972 * @param string $message
973 * @since Method available since Release 3.4.0
975 function assertStringEndsWith($suffix, $string, $message = '')
977 return PHPUnit_Framework_Assert::assertStringEndsWith($suffix, $string, $message);
981 * Asserts that the contents of a string is equal
982 * to the contents of a file.
984 * @param string $expectedFile
985 * @param string $actualString
986 * @param string $message
987 * @param boolean $canonicalize
988 * @param boolean $ignoreCase
989 * @since Method available since Release 3.3.0
991 function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
993 return PHPUnit_Framework_Assert::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
997 * Asserts that a string matches a given format string.
999 * @param string $format
1000 * @param string $string
1001 * @param string $message
1002 * @since Method available since Release 3.5.0
1004 function assertStringMatchesFormat($format, $string, $message = '')
1006 return PHPUnit_Framework_Assert::assertStringMatchesFormat($format, $string, $message);
1010 * Asserts that a string matches a given format file.
1012 * @param string $formatFile
1013 * @param string $string
1014 * @param string $message
1015 * @since Method available since Release 3.5.0
1017 function assertStringMatchesFormatFile($formatFile, $string, $message = '')
1019 return PHPUnit_Framework_Assert::assertStringMatchesFormatFile($formatFile, $string, $message);
1023 * Asserts that the contents of a string is not equal
1024 * to the contents of a file.
1026 * @param string $expectedFile
1027 * @param string $actualString
1028 * @param string $message
1029 * @param boolean $canonicalize
1030 * @param boolean $ignoreCase
1031 * @since Method available since Release 3.3.0
1033 function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
1035 return PHPUnit_Framework_Assert::assertStringNotEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
1039 * Asserts that a string does not match a given format string.
1041 * @param string $format
1042 * @param string $string
1043 * @param string $message
1044 * @since Method available since Release 3.5.0
1046 function assertStringNotMatchesFormat($format, $string, $message = '')
1048 return PHPUnit_Framework_Assert::assertStringNotMatchesFormat($format, $string, $message);
1052 * Asserts that a string does not match a given format string.
1054 * @param string $formatFile
1055 * @param string $string
1056 * @param string $message
1057 * @since Method available since Release 3.5.0
1059 function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
1061 return PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile($formatFile, $string, $message);
1065 * Asserts that a string starts not with a given prefix.
1067 * @param string $prefix
1068 * @param string $string
1069 * @param string $message
1070 * @since Method available since Release 3.4.0
1072 function assertStringStartsNotWith($prefix, $string, $message = '')
1074 return PHPUnit_Framework_Assert::assertStringStartsNotWith($prefix, $string, $message);
1078 * Asserts that a string starts with a given prefix.
1080 * @param string $prefix
1081 * @param string $string
1082 * @param string $message
1083 * @since Method available since Release 3.4.0
1085 function assertStringStartsWith($prefix, $string, $message = '')
1087 return PHPUnit_Framework_Assert::assertStringStartsWith($prefix, $string, $message);
1091 * Evaluate an HTML or XML string and assert its structure and/or contents.
1093 * The first argument ($matcher) is an associative array that specifies the
1094 * match criteria for the assertion:
1096 * - `id` : the node with the given id attribute must match the
1097 * corresponsing value.
1098 * - `tag` : the node type must match the corresponding value.
1099 * - `attributes` : a hash. The node's attributres must match the
1100 * corresponsing values in the hash.
1101 * - `content` : The text content must match the given value.
1102 * - `parent` : a hash. The node's parent must match the
1103 * corresponsing hash.
1104 * - `child`: a hash. At least one of the node's immediate children
1105 * must meet the criteria described by the hash.
1106 * - `ancestor` : a hash. At least one of the node's ancestors must
1107 * meet the criteria described by the hash.
1108 * - `descendant` : a hash. At least one of the node's descendants must
1109 * meet the criteria described by the hash.
1110 * - `children` : a hash, for counting children of a node.
1112 *- `count`: a number which must equal the number of children
1114 *- `less_than`: the number of matching children must be greater
1116 *- `greater_than` : the number of matching children must be less than
1118 *- `only` : another hash consisting of the keys to use to match
1119 * on the children, and only matching children will be
1123 * // Matcher that asserts that there is an element with an id="my_id".
1124 * $matcher = array('id' => 'my_id');
1126 * // Matcher that asserts that there is a "span" tag.
1127 * $matcher = array('tag' => 'span');
1129 * // Matcher that asserts that there is a "span" tag with the content
1131 * $matcher = array('tag' => 'span', 'content' => 'Hello World');
1133 * // Matcher that asserts that there is a "span" tag with content matching
1134 * // the regular expression pattern.
1135 * $matcher = array('tag' => 'span', 'content' => '/Try P(HP|ython)/');
1137 * // Matcher that asserts that there is a "span" with an "list" class
1141 * 'attributes' => array('class' => 'list')
1144 * // Matcher that asserts that there is a "span" inside of a "div".
1147 * 'parent' => array('tag' => 'div')
1150 * // Matcher that asserts that there is a "span" somewhere inside a
1154 * 'ancestor' => array('tag' => 'table')
1157 * // Matcher that asserts that there is a "span" with at least one "em"
1161 * 'child' => array('tag' => 'em')
1164 * // Matcher that asserts that there is a "span" containing a (possibly
1165 * // nested) "strong" tag.
1168 * 'descendant' => array('tag' => 'strong')
1171 * // Matcher that asserts that there is a "span" containing 5-10 "em" tags
1172 * // as immediate children.
1175 * 'children' => array(
1177 * 'greater_than' => 4,
1178 * 'only' => array('tag' => 'em')
1182 * // Matcher that asserts that there is a "div", with an "ul" ancestor and
1183 * // a "li" parent (with class="enum"), and containing a "span" descendant
1184 * // that contains an element with id="my_test" and the text "Hello World".
1187 * 'ancestor' => array('tag' => 'ul'),
1188 * 'parent' => array(
1190 * 'attributes' => array('class' => 'enum')
1192 * 'descendant' => array(
1195 * 'id' => 'my_test',
1196 * 'content' => 'Hello World'
1201 * // Use assertTag() to apply a $matcher to a piece of $html.
1202 * $this->assertTag($matcher, $html);
1204 * // Use assertTag() to apply a $matcher to a piece of $xml.
1205 * $this->assertTag($matcher, $xml, '', FALSE);
1208 * The second argument ($actual) is a string containing either HTML or
1209 * XML text to be tested.
1211 * The third argument ($message) is an optional message that will be
1212 * used if the assertion fails.
1214 * The fourth argument ($html) is an optional flag specifying whether
1215 * to load the $actual string into a DOMDocument using the HTML or
1216 * XML load strategy. It is TRUE by default, which assumes the HTML
1217 * load strategy. In many cases, this will be acceptable for XML as well.
1219 * @param array $matcher
1220 * @param string $actual
1221 * @param string $message
1222 * @param boolean $isHtml
1223 * @since Method available since Release 3.3.0
1224 * @author Mike Naberezny <mike@maintainable.com>
1225 * @author Derek DeVries <derek@maintainable.com>
1227 function assertTag($matcher, $actual, $message = '', $isHtml = TRUE)
1229 return PHPUnit_Framework_Assert::assertTag($matcher, $actual, $message, $isHtml);
1233 * Evaluates a PHPUnit_Framework_Constraint matcher object.
1235 * @param mixed$value
1236 * @param PHPUnit_Framework_Constraint $constraint
1237 * @param string $message
1238 * @since Method available since Release 3.0.0
1240 function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
1242 return PHPUnit_Framework_Assert::assertThat($value, $constraint, $message);
1246 * Asserts that a condition is true.
1248 * @param boolean $condition
1249 * @param string $message
1250 * @throws PHPUnit_Framework_AssertionFailedError
1252 function assertTrue($condition, $message = '')
1254 return PHPUnit_Framework_Assert::assertTrue($condition, $message);
1258 * Asserts that a variable is of a given type.
1260 * @param string $expected
1261 * @param mixed $actual
1262 * @param string $message
1264 function assertType($expected, $actual, $message = '')
1266 return PHPUnit_Framework_Assert::assertType($expected, $actual, $message);
1270 * Asserts that two XML files are equal.
1272 * @param string $expectedFile
1273 * @param string $actualFile
1274 * @param string $message
1275 * @since Method available since Release 3.1.0
1277 function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
1279 return PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message);
1283 * Asserts that two XML files are not equal.
1285 * @param string $expectedFile
1286 * @param string $actualFile
1287 * @param string $message
1288 * @since Method available since Release 3.1.0
1290 function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
1292 return PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message);
1296 * Asserts that two XML documents are equal.
1298 * @param string $expectedFile
1299 * @param string $actualXml
1300 * @param string $message
1301 * @since Method available since Release 3.3.0
1303 function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
1305 return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message);
1309 * Asserts that two XML documents are equal.
1311 * @param string $expectedXml
1312 * @param string $actualXml
1313 * @param string $message
1314 * @since Method available since Release 3.1.0
1316 function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
1318 return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message);
1322 * Asserts that two XML documents are not equal.
1324 * @param string $expectedFile
1325 * @param string $actualXml
1326 * @param string $message
1327 * @since Method available since Release 3.3.0
1329 function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
1331 return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message);
1335 * Asserts that two XML documents are not equal.
1337 * @param string $expectedXml
1338 * @param string $actualXml
1339 * @param string $message
1340 * @since Method available since Release 3.1.0
1342 function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
1344 return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message);
1348 * Returns a matcher that matches when the method it is evaluated for
1349 * is invoked at the given $index.
1351 * @param integer $index
1352 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
1353 * @since Method available since Release 3.0.0
1357 return PHPUnit_Framework_TestCase::at($index);
1361 * Returns a matcher that matches when the method it is evaluated for
1362 * is executed at least once.
1364 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
1365 * @since Method available since Release 3.0.0
1367 function atLeastOnce()
1369 return PHPUnit_Framework_TestCase::atLeastOnce();
1373 * Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
1375 * @param PHPUnit_Framework_Constraint $constraint
1376 * @param string $attributeName
1377 * @return PHPUnit_Framework_Constraint_Attribute
1378 * @since Method available since Release 3.1.0
1380 function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
1382 return PHPUnit_Framework_Assert::attribute($constraint, $attributeName);
1386 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
1387 * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
1390 * @param string $attributeName
1391 * @param mixed $value
1392 * @param float $delta
1393 * @param integer $maxDepth
1394 * @param boolean $canonicalize
1395 * @param boolean $ignoreCase
1396 * @return PHPUnit_Framework_Constraint_Attribute
1397 * @since Method available since Release 3.1.0
1399 function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1401 return PHPUnit_Framework_Assert::attributeEqualTo($attributeName, $value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1405 * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
1407 * @param string $attributeName
1408 * @return PHPUnit_Framework_Constraint_ClassHasAttribute
1409 * @since Method available since Release 3.1.0
1411 function classHasAttribute($attributeName)
1413 return PHPUnit_Framework_Assert::classHasAttribute($attributeName);
1417 * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
1420 * @param string $attributeName
1421 * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
1422 * @since Method available since Release 3.1.0
1424 function classHasStaticAttribute($attributeName)
1426 return PHPUnit_Framework_Assert::classHasStaticAttribute($attributeName);
1430 * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
1433 * @param mixed $value
1434 * @return PHPUnit_Framework_Constraint_TraversableContains
1435 * @since Method available since Release 3.0.0
1437 function contains($value)
1439 return PHPUnit_Framework_Assert::contains($value);
1443 * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1446 * @param string $type
1447 * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1448 * @since Method available since Release 3.1.4
1450 function containsOnly($type)
1452 return PHPUnit_Framework_Assert::containsOnly($type);
1456 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
1458 * @param mixed $value
1459 * @param float $delta
1460 * @param integer $maxDepth
1461 * @param boolean $canonicalize
1462 * @param boolean $ignoreCase
1463 * @return PHPUnit_Framework_Constraint_IsEqual
1464 * @since Method available since Release 3.0.0
1466 function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1468 return PHPUnit_Framework_Assert::equalTo($value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1472 * Returns a matcher that matches when the method it is evaluated for
1473 * is executed exactly $count times.
1475 * @param integer $count
1476 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1477 * @since Method available since Release 3.0.0
1479 function exactly($count)
1481 return PHPUnit_Framework_TestCase::exactly($count);
1485 * Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
1487 * @return PHPUnit_Framework_Constraint_FileExists
1488 * @since Method available since Release 3.0.0
1490 function fileExists()
1492 return PHPUnit_Framework_Assert::fileExists();
1496 * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
1498 * @param mixed $value
1499 * @return PHPUnit_Framework_Constraint_GreaterThan
1500 * @since Method available since Release 3.0.0
1502 function greaterThan($value)
1504 return PHPUnit_Framework_Assert::greaterThan($value);
1508 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
1509 * a PHPUnit_Framework_Constraint_IsEqual and a
1510 * PHPUnit_Framework_Constraint_GreaterThan matcher object.
1512 * @param mixed $value
1513 * @return PHPUnit_Framework_Constraint_Or
1514 * @since Method available since Release 3.1.0
1516 function greaterThanOrEqual($value)
1518 return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
1522 * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
1524 * @param mixed $value
1525 * @return PHPUnit_Framework_Constraint_IsIdentical
1526 * @since Method available since Release 3.0.0
1528 function identicalTo($value)
1530 return PHPUnit_Framework_Assert::identicalTo($value);
1534 * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
1536 * @return PHPUnit_Framework_Constraint_IsEmpty
1537 * @since Method available since Release 3.5.0
1541 return PHPUnit_Framework_Assert::isEmpty();
1545 * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
1547 * @return PHPUnit_Framework_Constraint_IsFalse
1548 * @since Method available since Release 3.3.0
1552 return PHPUnit_Framework_Assert::isFalse();
1556 * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
1558 * @param string $className
1559 * @return PHPUnit_Framework_Constraint_IsInstanceOf
1560 * @since Method available since Release 3.0.0
1562 function isInstanceOf($className)
1564 return PHPUnit_Framework_Assert::isInstanceOf($className);
1568 * Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
1570 * @return PHPUnit_Framework_Constraint_IsNull
1571 * @since Method available since Release 3.3.0
1575 return PHPUnit_Framework_Assert::isNull();
1579 * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
1581 * @return PHPUnit_Framework_Constraint_IsTrue
1582 * @since Method available since Release 3.3.0
1586 return PHPUnit_Framework_Assert::isTrue();
1590 * Returns a PHPUnit_Framework_Constraint_IsType matcher object.
1592 * @param string $type
1593 * @return PHPUnit_Framework_Constraint_IsType
1594 * @since Method available since Release 3.0.0
1596 function isType($type)
1598 return PHPUnit_Framework_Assert::isType($type);
1602 * Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
1604 * @param mixed $value
1605 * @return PHPUnit_Framework_Constraint_LessThan
1606 * @since Method available since Release 3.0.0
1608 function lessThan($value)
1610 return PHPUnit_Framework_Assert::lessThan($value);
1614 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
1615 * a PHPUnit_Framework_Constraint_IsEqual and a
1616 * PHPUnit_Framework_Constraint_LessThan matcher object.
1618 * @param mixed $value
1619 * @return PHPUnit_Framework_Constraint_Or
1620 * @since Method available since Release 3.1.0
1622 function lessThanOrEqual($value)
1624 return PHPUnit_Framework_Assert::lessThanOrEqual($value);
1628 * Returns a PHPUnit_Framework_Constraint_And matcher object.
1630 * @return PHPUnit_Framework_Constraint_And
1631 * @since Method available since Release 3.0.0
1633 function logicalAnd()
1635 return PHPUnit_Framework_Assert::logicalAnd();
1639 * Returns a PHPUnit_Framework_Constraint_Not matcher object.
1641 * @param PHPUnit_Framework_Constraint $constraint
1642 * @return PHPUnit_Framework_Constraint_Not
1643 * @since Method available since Release 3.0.0
1645 function logicalNot(PHPUnit_Framework_Constraint $constraint)
1647 return PHPUnit_Framework_Assert::logicalNot($constraint);
1651 * Returns a PHPUnit_Framework_Constraint_Or matcher object.
1653 * @return PHPUnit_Framework_Constraint_Or
1654 * @since Method available since Release 3.0.0
1656 function logicalOr()
1658 return PHPUnit_Framework_Assert::logicalOr();
1662 * Returns a PHPUnit_Framework_Constraint_Xor matcher object.
1664 * @return PHPUnit_Framework_Constraint_Xor
1665 * @since Method available since Release 3.0.0
1667 function logicalXor()
1669 return PHPUnit_Framework_Assert::logicalXor();
1673 * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
1675 * @param string $string
1676 * @return PHPUnit_Framework_Constraint_StringMatches
1677 * @since Method available since Release 3.5.0
1679 function matches($string)
1681 return PHPUnit_Framework_Assert::matches($string);
1685 * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
1687 * @param string $pattern
1688 * @return PHPUnit_Framework_Constraint_PCREMatch
1689 * @since Method available since Release 3.0.0
1691 function matchesRegularExpression($pattern)
1693 return PHPUnit_Framework_Assert::matchesRegularExpression($pattern);
1697 * Returns a matcher that matches when the method it is evaluated for
1698 * is never executed.
1700 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1701 * @since Method available since Release 3.0.0
1705 return PHPUnit_Framework_TestCase::never();
1709 * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
1711 * @param string $attributeName
1712 * @return PHPUnit_Framework_Constraint_ObjectHasAttribute
1713 * @since Method available since Release 3.0.0
1715 function objectHasAttribute($attributeName)
1717 return PHPUnit_Framework_Assert::objectHasAttribute($attributeName);
1723 * @param mixed $value, ...
1724 * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
1725 * @since Method available since Release 3.0.0
1727 function onConsecutiveCalls()
1729 return PHPUnit_Framework_TestCase::onConsecutiveCalls();
1733 * Returns a matcher that matches when the method it is evaluated for
1734 * is executed exactly once.
1736 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1737 * @since Method available since Release 3.0.0
1741 return PHPUnit_Framework_TestCase::once();
1747 * @param integer $argumentIndex
1748 * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
1749 * @since Method available since Release 3.3.0
1751 function returnArgument($argumentIndex)
1753 return PHPUnit_Framework_TestCase::returnArgument($argumentIndex);
1759 * @param mixed $callback
1760 * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
1761 * @since Method available since Release 3.3.0
1763 function returnCallback($callback)
1765 return PHPUnit_Framework_TestCase::returnCallback($callback);
1771 * @param mixed $value
1772 * @return PHPUnit_Framework_MockObject_Stub_Return
1773 * @since Method available since Release 3.0.0
1775 function returnValue($value)
1777 return PHPUnit_Framework_TestCase::returnValue($value);
1781 * Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
1783 * @param string $string
1784 * @param boolean $case
1785 * @return PHPUnit_Framework_Constraint_StringContains
1786 * @since Method available since Release 3.0.0
1788 function stringContains($string, $case = TRUE)
1790 return PHPUnit_Framework_Assert::stringContains($string, $case);
1794 * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
1796 * @param mixed $suffix
1797 * @return PHPUnit_Framework_Constraint_StringEndsWith
1798 * @since Method available since Release 3.4.0
1800 function stringEndsWith($suffix)
1802 return PHPUnit_Framework_Assert::stringEndsWith($suffix);
1806 * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
1808 * @param mixed $prefix
1809 * @return PHPUnit_Framework_Constraint_StringStartsWith
1810 * @since Method available since Release 3.4.0
1812 function stringStartsWith($prefix)
1814 return PHPUnit_Framework_Assert::stringStartsWith($prefix);
1820 * @param Exception $exception
1821 * @return PHPUnit_Framework_MockObject_Stub_Exception
1822 * @since Method available since Release 3.1.0
1824 function throwException(Exception $exception)
1826 return PHPUnit_Framework_TestCase::throwException($exception);