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
370 function assertAttributeNotType($expected, $attributeName, $classOrObject, $message = '')
372 return PHPUnit_Framework_Assert::assertAttributeNotType($expected, $attributeName, $classOrObject, $message);
376 * Asserts that a variable and an attribute of an object have the same type
379 * @param mixed $expected
380 * @param string $actualAttributeName
381 * @param object $actualClassOrObject
382 * @param string $message
384 function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
386 return PHPUnit_Framework_Assert::assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message);
390 * Asserts that an attribute is of a given type.
392 * @param string $expected
393 * @param string $attributeName
394 * @param mixed $classOrObject
395 * @param string $message
396 * @since Method available since Release 3.4.0
399 function assertAttributeType($expected, $attributeName, $classOrObject, $message = '')
401 return PHPUnit_Framework_Assert::assertAttributeType($expected, $attributeName, $classOrObject, $message);
405 * Asserts that a class has a specified attribute.
407 * @param string $attributeName
408 * @param string $className
409 * @param string $message
410 * @since Method available since Release 3.1.0
412 function assertClassHasAttribute($attributeName, $className, $message = '')
414 return PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $className, $message);
418 * Asserts that a class has a specified static attribute.
420 * @param string $attributeName
421 * @param string $className
422 * @param string $message
423 * @since Method available since Release 3.1.0
425 function assertClassHasStaticAttribute($attributeName, $className, $message = '')
427 return PHPUnit_Framework_Assert::assertClassHasStaticAttribute($attributeName, $className, $message);
431 * Asserts that a class does not have a specified attribute.
433 * @param string $attributeName
434 * @param string $className
435 * @param string $message
436 * @since Method available since Release 3.1.0
438 function assertClassNotHasAttribute($attributeName, $className, $message = '')
440 return PHPUnit_Framework_Assert::assertClassNotHasAttribute($attributeName, $className, $message);
444 * Asserts that a class does not have a specified static attribute.
446 * @param string $attributeName
447 * @param string $className
448 * @param string $message
449 * @since Method available since Release 3.1.0
451 function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
453 return PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute($attributeName, $className, $message);
457 * Asserts that a haystack contains a needle.
459 * @param mixed $needle
460 * @param mixed $haystack
461 * @param string $message
462 * @param boolean $ignoreCase
463 * @since Method available since Release 2.1.0
465 function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
467 return PHPUnit_Framework_Assert::assertContains($needle, $haystack, $message, $ignoreCase);
471 * Asserts that a haystack contains only values of a given type.
473 * @param string $type
474 * @param mixed $haystack
475 * @param boolean $isNativeType
476 * @param string $message
477 * @since Method available since Release 3.1.4
479 function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
481 return PHPUnit_Framework_Assert::assertContainsOnly($type, $haystack, $isNativeType, $message);
485 * Asserts that a variable is empty.
487 * @param mixed $actual
488 * @param string $message
489 * @throws PHPUnit_Framework_AssertionFailedError
491 function assertEmpty($actual, $message = '')
493 return PHPUnit_Framework_Assert::assertEmpty($actual, $message);
497 * Asserts that a hierarchy of DOMNodes matches.
499 * @param DOMNode $expectedNode
500 * @param DOMNode $actualNode
501 * @param boolean $checkAttributes
502 * @param string $message
503 * @author Mattis Stordalen Flister <mattis@xait.no>
504 * @since Method available since Release 3.3.0
506 function assertEqualXMLStructure(DOMNode $expectedNode, DOMNode $actualNode, $checkAttributes = FALSE, $message = '')
508 return PHPUnit_Framework_Assert::assertEqualXMLStructure($expectedNode, $actualNode, $checkAttributes, $message);
512 * Asserts that two variables are equal.
514 * @param mixed $expected
515 * @param mixed $actual
516 * @param string $message
517 * @param float $delta
518 * @param integer $maxDepth
519 * @param boolean $canonicalize
520 * @param boolean $ignoreCase
522 function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
524 return PHPUnit_Framework_Assert::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
528 * Asserts that a condition is false.
530 * @param boolean $condition
531 * @param string $message
532 * @throws PHPUnit_Framework_AssertionFailedError
534 function assertFalse($condition, $message = '')
536 return PHPUnit_Framework_Assert::assertFalse($condition, $message);
540 * Asserts that the contents of one file is equal to the contents of another
543 * @param string $expected
544 * @param string $actual
545 * @param string $message
546 * @param boolean $canonicalize
547 * @param boolean $ignoreCase
548 * @since Method available since Release 3.2.14
550 function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
552 return PHPUnit_Framework_Assert::assertFileEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
556 * Asserts that a file exists.
558 * @param string $filename
559 * @param string $message
560 * @since Method available since Release 3.0.0
562 function assertFileExists($filename, $message = '')
564 return PHPUnit_Framework_Assert::assertFileExists($filename, $message);
568 * Asserts that the contents of one file is not equal to the contents of
571 * @param string $expected
572 * @param string $actual
573 * @param string $message
574 * @param boolean $canonicalize
575 * @param boolean $ignoreCase
576 * @since Method available since Release 3.2.14
578 function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
580 return PHPUnit_Framework_Assert::assertFileNotEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
584 * Asserts that a file does not exist.
586 * @param string $filename
587 * @param string $message
588 * @since Method available since Release 3.0.0
590 function assertFileNotExists($filename, $message = '')
592 return PHPUnit_Framework_Assert::assertFileNotExists($filename, $message);
596 * Asserts that a value is greater than another value.
598 * @param mixed $expected
599 * @param mixed $actual
600 * @param string $message
601 * @since Method available since Release 3.1.0
603 function assertGreaterThan($expected, $actual, $message = '')
605 return PHPUnit_Framework_Assert::assertGreaterThan($expected, $actual, $message);
609 * Asserts that a value is greater than or equal to another value.
611 * @param mixed $expected
612 * @param mixed $actual
613 * @param string $message
614 * @since Method available since Release 3.1.0
616 function assertGreaterThanOrEqual($expected, $actual, $message = '')
618 return PHPUnit_Framework_Assert::assertGreaterThanOrEqual($expected, $actual, $message);
622 * Asserts that a variable is of a given type.
624 * @param string $expected
625 * @param mixed $actual
626 * @param string $message
627 * @since Method available since Release 3.5.0
629 function assertInstanceOf($expected, $actual, $message = '')
631 return PHPUnit_Framework_Assert::assertInstanceOf($expected, $actual, $message);
635 * Asserts that a variable is of a given type.
637 * @param string $expected
638 * @param mixed $actual
639 * @param string $message
640 * @since Method available since Release 3.5.0
642 function assertInternalType($expected, $actual, $message = '')
644 return PHPUnit_Framework_Assert::assertInternalType($expected, $actual, $message);
648 * Asserts that a value is smaller than another value.
650 * @param mixed $expected
651 * @param mixed $actual
652 * @param string $message
653 * @since Method available since Release 3.1.0
655 function assertLessThan($expected, $actual, $message = '')
657 return PHPUnit_Framework_Assert::assertLessThan($expected, $actual, $message);
661 * Asserts that a value is smaller than or equal to another value.
663 * @param mixed $expected
664 * @param mixed $actual
665 * @param string $message
666 * @since Method available since Release 3.1.0
668 function assertLessThanOrEqual($expected, $actual, $message = '')
670 return PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $message);
674 * Asserts that a haystack does not contain a needle.
676 * @param mixed $needle
677 * @param mixed $haystack
678 * @param string $message
679 * @param boolean $ignoreCase
680 * @since Method available since Release 2.1.0
682 function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
684 return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase);
688 * Asserts that a haystack does not contain only values of a given type.
690 * @param string $type
691 * @param mixed $haystack
692 * @param boolean $isNativeType
693 * @param string $message
694 * @since Method available since Release 3.1.4
696 function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
698 return PHPUnit_Framework_Assert::assertNotContainsOnly($type, $haystack, $isNativeType, $message);
702 * Asserts that a variable is not empty.
704 * @param mixed $actual
705 * @param string $message
706 * @throws PHPUnit_Framework_AssertionFailedError
708 function assertNotEmpty($actual, $message = '')
710 return PHPUnit_Framework_Assert::assertNotEmpty($actual, $message);
714 * Asserts that two variables are not equal.
716 * @param mixed $expected
717 * @param mixed $actual
718 * @param string $message
719 * @param float $delta
720 * @param integer $maxDepth
721 * @param boolean $canonicalize
722 * @param boolean $ignoreCase
723 * @since Method available since Release 2.3.0
725 function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
727 return PHPUnit_Framework_Assert::assertNotEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
731 * Asserts that a variable is not of a given type.
733 * @param string $expected
734 * @param mixed $actual
735 * @param string $message
736 * @since Method available since Release 3.5.0
738 function assertNotInstanceOf($expected, $actual, $message = '')
740 return PHPUnit_Framework_Assert::assertNotInstanceOf($expected, $actual, $message);
744 * Asserts that a variable is not of a given type.
746 * @param string $expected
747 * @param mixed $actual
748 * @param string $message
749 * @since Method available since Release 3.5.0
751 function assertNotInternalType($expected, $actual, $message = '')
753 return PHPUnit_Framework_Assert::assertNotInternalType($expected, $actual, $message);
757 * Asserts that a variable is not NULL.
759 * @param mixed $actual
760 * @param string $message
762 function assertNotNull($actual, $message = '')
764 return PHPUnit_Framework_Assert::assertNotNull($actual, $message);
768 * Asserts that a string does not match a given regular expression.
770 * @param string $pattern
771 * @param string $string
772 * @param string $message
773 * @since Method available since Release 2.1.0
775 function assertNotRegExp($pattern, $string, $message = '')
777 return PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
781 * Asserts that two variables do not have the same type and value.
782 * Used on objects, it asserts that two variables do not reference
785 * @param mixed $expected
786 * @param mixed $actual
787 * @param string $message
789 function assertNotSame($expected, $actual, $message = '')
791 return PHPUnit_Framework_Assert::assertNotSame($expected, $actual, $message);
795 * This assertion is the exact opposite of assertTag().
797 * Rather than asserting that $matcher results in a match, it asserts that
798 * $matcher does not match.
800 * @param array $matcher
801 * @param string $actual
802 * @param string $message
803 * @param boolean $isHtml
804 * @since Method available since Release 3.3.0
805 * @author Mike Naberezny <mike@maintainable.com>
806 * @author Derek DeVries <derek@maintainable.com>
808 function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE)
810 return PHPUnit_Framework_Assert::assertNotTag($matcher, $actual, $message, $isHtml);
814 * Asserts that a variable is not of a given type.
816 * @param string $expected
817 * @param mixed $actual
818 * @param string $message
819 * @since Method available since Release 2.2.0
822 function assertNotType($expected, $actual, $message = '')
824 return PHPUnit_Framework_Assert::assertNotType($expected, $actual, $message);
828 * Asserts that a variable is NULL.
830 * @param mixed $actual
831 * @param string $message
833 function assertNull($actual, $message = '')
835 return PHPUnit_Framework_Assert::assertNull($actual, $message);
839 * Asserts that an object has a specified attribute.
841 * @param string $attributeName
842 * @param object $object
843 * @param string $message
844 * @since Method available since Release 3.0.0
846 function assertObjectHasAttribute($attributeName, $object, $message = '')
848 return PHPUnit_Framework_Assert::assertObjectHasAttribute($attributeName, $object, $message);
852 * Asserts that an object does not have a specified attribute.
854 * @param string $attributeName
855 * @param object $object
856 * @param string $message
857 * @since Method available since Release 3.0.0
859 function assertObjectNotHasAttribute($attributeName, $object, $message = '')
861 return PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $object, $message);
865 * Asserts that a string matches a given regular expression.
867 * @param string $pattern
868 * @param string $string
869 * @param string $message
871 function assertRegExp($pattern, $string, $message = '')
873 return PHPUnit_Framework_Assert::assertRegExp($pattern, $string, $message);
877 * Asserts that two variables have the same type and value.
878 * Used on objects, it asserts that two variables reference
881 * @param mixed $expected
882 * @param mixed $actual
883 * @param string $message
885 function assertSame($expected, $actual, $message = '')
887 return PHPUnit_Framework_Assert::assertSame($expected, $actual, $message);
891 * Assert the presence, absence, or count of elements in a document matching
892 * the CSS $selector, regardless of the contents of those elements.
894 * The first argument, $selector, is the CSS selector used to match
895 * the elements in the $actual document.
897 * The second argument, $count, can be either boolean or numeric.
898 * When boolean, it asserts for presence of elements matching the selector
899 * (TRUE) or absence of elements (FALSE).
900 * When numeric, it asserts the count of elements.
902 * assertSelectCount("#binder", true, $xml); // any?
903 * assertSelectCount(".binder", 3, $xml); // exactly 3?
905 * @param array $selector
906 * @param integer $count
907 * @param mixed $actual
908 * @param string $message
909 * @param boolean $isHtml
910 * @since Method available since Release 3.3.0
911 * @author Mike Naberezny <mike@maintainable.com>
912 * @author Derek DeVries <derek@maintainable.com>
914 function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE)
916 return PHPUnit_Framework_Assert::assertSelectCount($selector, $count, $actual, $message, $isHtml);
920 * assertSelectEquals("#binder .name", "Chuck", true, $xml); // any?
921 * assertSelectEquals("#binder .name", "Chuck", false, $xml); // none?
923 * @param array $selector
924 * @param string $content
925 * @param integer $count
926 * @param mixed $actual
927 * @param string $message
928 * @param boolean $isHtml
929 * @since Method available since Release 3.3.0
930 * @author Mike Naberezny <mike@maintainable.com>
931 * @author Derek DeVries <derek@maintainable.com>
933 function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE)
935 return PHPUnit_Framework_Assert::assertSelectEquals($selector, $content, $count, $actual, $message, $isHtml);
939 * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
940 * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
942 * @param array $selector
943 * @param string $pattern
944 * @param integer $count
945 * @param mixed $actual
946 * @param string $message
947 * @param boolean $isHtml
948 * @since Method available since Release 3.3.0
949 * @author Mike Naberezny <mike@maintainable.com>
950 * @author Derek DeVries <derek@maintainable.com>
952 function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE)
954 return PHPUnit_Framework_Assert::assertSelectRegExp($selector, $pattern, $count, $actual, $message, $isHtml);
958 * Asserts that a string ends not with a given prefix.
960 * @param string $suffix
961 * @param string $string
962 * @param string $message
963 * @since Method available since Release 3.4.0
965 function assertStringEndsNotWith($suffix, $string, $message = '')
967 return PHPUnit_Framework_Assert::assertStringEndsNotWith($suffix, $string, $message);
971 * Asserts that a string ends with a given prefix.
973 * @param string $suffix
974 * @param string $string
975 * @param string $message
976 * @since Method available since Release 3.4.0
978 function assertStringEndsWith($suffix, $string, $message = '')
980 return PHPUnit_Framework_Assert::assertStringEndsWith($suffix, $string, $message);
984 * Asserts that the contents of a string is equal
985 * to the contents of a file.
987 * @param string $expectedFile
988 * @param string $actualString
989 * @param string $message
990 * @param boolean $canonicalize
991 * @param boolean $ignoreCase
992 * @since Method available since Release 3.3.0
994 function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
996 return PHPUnit_Framework_Assert::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
1000 * Asserts that a string matches a given format string.
1002 * @param string $format
1003 * @param string $string
1004 * @param string $message
1005 * @since Method available since Release 3.5.0
1007 function assertStringMatchesFormat($format, $string, $message = '')
1009 return PHPUnit_Framework_Assert::assertStringMatchesFormat($format, $string, $message);
1013 * Asserts that a string matches a given format file.
1015 * @param string $formatFile
1016 * @param string $string
1017 * @param string $message
1018 * @since Method available since Release 3.5.0
1020 function assertStringMatchesFormatFile($formatFile, $string, $message = '')
1022 return PHPUnit_Framework_Assert::assertStringMatchesFormatFile($formatFile, $string, $message);
1026 * Asserts that the contents of a string is not equal
1027 * to the contents of a file.
1029 * @param string $expectedFile
1030 * @param string $actualString
1031 * @param string $message
1032 * @param boolean $canonicalize
1033 * @param boolean $ignoreCase
1034 * @since Method available since Release 3.3.0
1036 function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
1038 return PHPUnit_Framework_Assert::assertStringNotEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
1042 * Asserts that a string does not match a given format string.
1044 * @param string $format
1045 * @param string $string
1046 * @param string $message
1047 * @since Method available since Release 3.5.0
1049 function assertStringNotMatchesFormat($format, $string, $message = '')
1051 return PHPUnit_Framework_Assert::assertStringNotMatchesFormat($format, $string, $message);
1055 * Asserts that a string does not match a given format string.
1057 * @param string $formatFile
1058 * @param string $string
1059 * @param string $message
1060 * @since Method available since Release 3.5.0
1062 function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
1064 return PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile($formatFile, $string, $message);
1068 * Asserts that a string starts not with a given prefix.
1070 * @param string $prefix
1071 * @param string $string
1072 * @param string $message
1073 * @since Method available since Release 3.4.0
1075 function assertStringStartsNotWith($prefix, $string, $message = '')
1077 return PHPUnit_Framework_Assert::assertStringStartsNotWith($prefix, $string, $message);
1081 * Asserts that a string starts with a given prefix.
1083 * @param string $prefix
1084 * @param string $string
1085 * @param string $message
1086 * @since Method available since Release 3.4.0
1088 function assertStringStartsWith($prefix, $string, $message = '')
1090 return PHPUnit_Framework_Assert::assertStringStartsWith($prefix, $string, $message);
1094 * Evaluate an HTML or XML string and assert its structure and/or contents.
1096 * The first argument ($matcher) is an associative array that specifies the
1097 * match criteria for the assertion:
1099 * - `id` : the node with the given id attribute must match the
1100 * corresponsing value.
1101 * - `tag` : the node type must match the corresponding value.
1102 * - `attributes` : a hash. The node's attributres must match the
1103 * corresponsing values in the hash.
1104 * - `content` : The text content must match the given value.
1105 * - `parent` : a hash. The node's parent must match the
1106 * corresponsing hash.
1107 * - `child`: a hash. At least one of the node's immediate children
1108 * must meet the criteria described by the hash.
1109 * - `ancestor` : a hash. At least one of the node's ancestors must
1110 * meet the criteria described by the hash.
1111 * - `descendant` : a hash. At least one of the node's descendants must
1112 * meet the criteria described by the hash.
1113 * - `children` : a hash, for counting children of a node.
1115 *- `count`: a number which must equal the number of children
1117 *- `less_than`: the number of matching children must be greater
1119 *- `greater_than` : the number of matching children must be less than
1121 *- `only` : another hash consisting of the keys to use to match
1122 * on the children, and only matching children will be
1126 * // Matcher that asserts that there is an element with an id="my_id".
1127 * $matcher = array('id' => 'my_id');
1129 * // Matcher that asserts that there is a "span" tag.
1130 * $matcher = array('tag' => 'span');
1132 * // Matcher that asserts that there is a "span" tag with the content
1134 * $matcher = array('tag' => 'span', 'content' => 'Hello World');
1136 * // Matcher that asserts that there is a "span" tag with content matching
1137 * // the regular expression pattern.
1138 * $matcher = array('tag' => 'span', 'content' => '/Try P(HP|ython)/');
1140 * // Matcher that asserts that there is a "span" with an "list" class
1144 * 'attributes' => array('class' => 'list')
1147 * // Matcher that asserts that there is a "span" inside of a "div".
1150 * 'parent' => array('tag' => 'div')
1153 * // Matcher that asserts that there is a "span" somewhere inside a
1157 * 'ancestor' => array('tag' => 'table')
1160 * // Matcher that asserts that there is a "span" with at least one "em"
1164 * 'child' => array('tag' => 'em')
1167 * // Matcher that asserts that there is a "span" containing a (possibly
1168 * // nested) "strong" tag.
1171 * 'descendant' => array('tag' => 'strong')
1174 * // Matcher that asserts that there is a "span" containing 5-10 "em" tags
1175 * // as immediate children.
1178 * 'children' => array(
1180 * 'greater_than' => 4,
1181 * 'only' => array('tag' => 'em')
1185 * // Matcher that asserts that there is a "div", with an "ul" ancestor and
1186 * // a "li" parent (with class="enum"), and containing a "span" descendant
1187 * // that contains an element with id="my_test" and the text "Hello World".
1190 * 'ancestor' => array('tag' => 'ul'),
1191 * 'parent' => array(
1193 * 'attributes' => array('class' => 'enum')
1195 * 'descendant' => array(
1198 * 'id' => 'my_test',
1199 * 'content' => 'Hello World'
1204 * // Use assertTag() to apply a $matcher to a piece of $html.
1205 * $this->assertTag($matcher, $html);
1207 * // Use assertTag() to apply a $matcher to a piece of $xml.
1208 * $this->assertTag($matcher, $xml, '', FALSE);
1211 * The second argument ($actual) is a string containing either HTML or
1212 * XML text to be tested.
1214 * The third argument ($message) is an optional message that will be
1215 * used if the assertion fails.
1217 * The fourth argument ($html) is an optional flag specifying whether
1218 * to load the $actual string into a DOMDocument using the HTML or
1219 * XML load strategy. It is TRUE by default, which assumes the HTML
1220 * load strategy. In many cases, this will be acceptable for XML as well.
1222 * @param array $matcher
1223 * @param string $actual
1224 * @param string $message
1225 * @param boolean $isHtml
1226 * @since Method available since Release 3.3.0
1227 * @author Mike Naberezny <mike@maintainable.com>
1228 * @author Derek DeVries <derek@maintainable.com>
1230 function assertTag($matcher, $actual, $message = '', $isHtml = TRUE)
1232 return PHPUnit_Framework_Assert::assertTag($matcher, $actual, $message, $isHtml);
1236 * Evaluates a PHPUnit_Framework_Constraint matcher object.
1238 * @param mixed$value
1239 * @param PHPUnit_Framework_Constraint $constraint
1240 * @param string $message
1241 * @since Method available since Release 3.0.0
1243 function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
1245 return PHPUnit_Framework_Assert::assertThat($value, $constraint, $message);
1249 * Asserts that a condition is true.
1251 * @param boolean $condition
1252 * @param string $message
1253 * @throws PHPUnit_Framework_AssertionFailedError
1255 function assertTrue($condition, $message = '')
1257 return PHPUnit_Framework_Assert::assertTrue($condition, $message);
1261 * Asserts that a variable is of a given type.
1263 * @param string $expected
1264 * @param mixed $actual
1265 * @param string $message
1268 function assertType($expected, $actual, $message = '')
1270 return PHPUnit_Framework_Assert::assertType($expected, $actual, $message);
1274 * Asserts that two XML files are equal.
1276 * @param string $expectedFile
1277 * @param string $actualFile
1278 * @param string $message
1279 * @since Method available since Release 3.1.0
1281 function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
1283 return PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message);
1287 * Asserts that two XML files are not equal.
1289 * @param string $expectedFile
1290 * @param string $actualFile
1291 * @param string $message
1292 * @since Method available since Release 3.1.0
1294 function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
1296 return PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message);
1300 * Asserts that two XML documents are equal.
1302 * @param string $expectedFile
1303 * @param string $actualXml
1304 * @param string $message
1305 * @since Method available since Release 3.3.0
1307 function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
1309 return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message);
1313 * Asserts that two XML documents are equal.
1315 * @param string $expectedXml
1316 * @param string $actualXml
1317 * @param string $message
1318 * @since Method available since Release 3.1.0
1320 function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
1322 return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message);
1326 * Asserts that two XML documents are not equal.
1328 * @param string $expectedFile
1329 * @param string $actualXml
1330 * @param string $message
1331 * @since Method available since Release 3.3.0
1333 function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
1335 return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message);
1339 * Asserts that two XML documents are not equal.
1341 * @param string $expectedXml
1342 * @param string $actualXml
1343 * @param string $message
1344 * @since Method available since Release 3.1.0
1346 function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
1348 return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message);
1352 * Returns a matcher that matches when the method it is evaluated for
1353 * is invoked at the given $index.
1355 * @param integer $index
1356 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
1357 * @since Method available since Release 3.0.0
1361 return PHPUnit_Framework_TestCase::at($index);
1365 * Returns a matcher that matches when the method it is evaluated for
1366 * is executed at least once.
1368 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
1369 * @since Method available since Release 3.0.0
1371 function atLeastOnce()
1373 return PHPUnit_Framework_TestCase::atLeastOnce();
1377 * Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
1379 * @param PHPUnit_Framework_Constraint $constraint
1380 * @param string $attributeName
1381 * @return PHPUnit_Framework_Constraint_Attribute
1382 * @since Method available since Release 3.1.0
1384 function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
1386 return PHPUnit_Framework_Assert::attribute($constraint, $attributeName);
1390 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
1391 * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
1394 * @param string $attributeName
1395 * @param mixed $value
1396 * @param float $delta
1397 * @param integer $maxDepth
1398 * @param boolean $canonicalize
1399 * @param boolean $ignoreCase
1400 * @return PHPUnit_Framework_Constraint_Attribute
1401 * @since Method available since Release 3.1.0
1403 function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1405 return PHPUnit_Framework_Assert::attributeEqualTo($attributeName, $value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1409 * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
1411 * @param string $attributeName
1412 * @return PHPUnit_Framework_Constraint_ClassHasAttribute
1413 * @since Method available since Release 3.1.0
1415 function classHasAttribute($attributeName)
1417 return PHPUnit_Framework_Assert::classHasAttribute($attributeName);
1421 * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
1424 * @param string $attributeName
1425 * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
1426 * @since Method available since Release 3.1.0
1428 function classHasStaticAttribute($attributeName)
1430 return PHPUnit_Framework_Assert::classHasStaticAttribute($attributeName);
1434 * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
1437 * @param mixed $value
1438 * @return PHPUnit_Framework_Constraint_TraversableContains
1439 * @since Method available since Release 3.0.0
1441 function contains($value)
1443 return PHPUnit_Framework_Assert::contains($value);
1447 * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1450 * @param string $type
1451 * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1452 * @since Method available since Release 3.1.4
1454 function containsOnly($type)
1456 return PHPUnit_Framework_Assert::containsOnly($type);
1460 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
1462 * @param mixed $value
1463 * @param float $delta
1464 * @param integer $maxDepth
1465 * @param boolean $canonicalize
1466 * @param boolean $ignoreCase
1467 * @return PHPUnit_Framework_Constraint_IsEqual
1468 * @since Method available since Release 3.0.0
1470 function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1472 return PHPUnit_Framework_Assert::equalTo($value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1476 * Returns a matcher that matches when the method it is evaluated for
1477 * is executed exactly $count times.
1479 * @param integer $count
1480 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1481 * @since Method available since Release 3.0.0
1483 function exactly($count)
1485 return PHPUnit_Framework_TestCase::exactly($count);
1489 * Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
1491 * @return PHPUnit_Framework_Constraint_FileExists
1492 * @since Method available since Release 3.0.0
1494 function fileExists()
1496 return PHPUnit_Framework_Assert::fileExists();
1500 * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
1502 * @param mixed $value
1503 * @return PHPUnit_Framework_Constraint_GreaterThan
1504 * @since Method available since Release 3.0.0
1506 function greaterThan($value)
1508 return PHPUnit_Framework_Assert::greaterThan($value);
1512 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
1513 * a PHPUnit_Framework_Constraint_IsEqual and a
1514 * PHPUnit_Framework_Constraint_GreaterThan matcher object.
1516 * @param mixed $value
1517 * @return PHPUnit_Framework_Constraint_Or
1518 * @since Method available since Release 3.1.0
1520 function greaterThanOrEqual($value)
1522 return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
1526 * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
1528 * @param mixed $value
1529 * @return PHPUnit_Framework_Constraint_IsIdentical
1530 * @since Method available since Release 3.0.0
1532 function identicalTo($value)
1534 return PHPUnit_Framework_Assert::identicalTo($value);
1538 * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
1540 * @return PHPUnit_Framework_Constraint_IsEmpty
1541 * @since Method available since Release 3.5.0
1545 return PHPUnit_Framework_Assert::isEmpty();
1549 * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
1551 * @return PHPUnit_Framework_Constraint_IsFalse
1552 * @since Method available since Release 3.3.0
1556 return PHPUnit_Framework_Assert::isFalse();
1560 * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
1562 * @param string $className
1563 * @return PHPUnit_Framework_Constraint_IsInstanceOf
1564 * @since Method available since Release 3.0.0
1566 function isInstanceOf($className)
1568 return PHPUnit_Framework_Assert::isInstanceOf($className);
1572 * Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
1574 * @return PHPUnit_Framework_Constraint_IsNull
1575 * @since Method available since Release 3.3.0
1579 return PHPUnit_Framework_Assert::isNull();
1583 * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
1585 * @return PHPUnit_Framework_Constraint_IsTrue
1586 * @since Method available since Release 3.3.0
1590 return PHPUnit_Framework_Assert::isTrue();
1594 * Returns a PHPUnit_Framework_Constraint_IsType matcher object.
1596 * @param string $type
1597 * @return PHPUnit_Framework_Constraint_IsType
1598 * @since Method available since Release 3.0.0
1600 function isType($type)
1602 return PHPUnit_Framework_Assert::isType($type);
1606 * Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
1608 * @param mixed $value
1609 * @return PHPUnit_Framework_Constraint_LessThan
1610 * @since Method available since Release 3.0.0
1612 function lessThan($value)
1614 return PHPUnit_Framework_Assert::lessThan($value);
1618 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
1619 * a PHPUnit_Framework_Constraint_IsEqual and a
1620 * PHPUnit_Framework_Constraint_LessThan matcher object.
1622 * @param mixed $value
1623 * @return PHPUnit_Framework_Constraint_Or
1624 * @since Method available since Release 3.1.0
1626 function lessThanOrEqual($value)
1628 return PHPUnit_Framework_Assert::lessThanOrEqual($value);
1632 * Returns a PHPUnit_Framework_Constraint_And matcher object.
1634 * @return PHPUnit_Framework_Constraint_And
1635 * @since Method available since Release 3.0.0
1637 function logicalAnd()
1639 return PHPUnit_Framework_Assert::logicalAnd();
1643 * Returns a PHPUnit_Framework_Constraint_Not matcher object.
1645 * @param PHPUnit_Framework_Constraint $constraint
1646 * @return PHPUnit_Framework_Constraint_Not
1647 * @since Method available since Release 3.0.0
1649 function logicalNot(PHPUnit_Framework_Constraint $constraint)
1651 return PHPUnit_Framework_Assert::logicalNot($constraint);
1655 * Returns a PHPUnit_Framework_Constraint_Or matcher object.
1657 * @return PHPUnit_Framework_Constraint_Or
1658 * @since Method available since Release 3.0.0
1660 function logicalOr()
1662 return PHPUnit_Framework_Assert::logicalOr();
1666 * Returns a PHPUnit_Framework_Constraint_Xor matcher object.
1668 * @return PHPUnit_Framework_Constraint_Xor
1669 * @since Method available since Release 3.0.0
1671 function logicalXor()
1673 return PHPUnit_Framework_Assert::logicalXor();
1677 * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
1679 * @param string $string
1680 * @return PHPUnit_Framework_Constraint_StringMatches
1681 * @since Method available since Release 3.5.0
1683 function matches($string)
1685 return PHPUnit_Framework_Assert::matches($string);
1689 * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
1691 * @param string $pattern
1692 * @return PHPUnit_Framework_Constraint_PCREMatch
1693 * @since Method available since Release 3.0.0
1695 function matchesRegularExpression($pattern)
1697 return PHPUnit_Framework_Assert::matchesRegularExpression($pattern);
1701 * Returns a matcher that matches when the method it is evaluated for
1702 * is never executed.
1704 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1705 * @since Method available since Release 3.0.0
1709 return PHPUnit_Framework_TestCase::never();
1713 * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
1715 * @param string $attributeName
1716 * @return PHPUnit_Framework_Constraint_ObjectHasAttribute
1717 * @since Method available since Release 3.0.0
1719 function objectHasAttribute($attributeName)
1721 return PHPUnit_Framework_Assert::objectHasAttribute($attributeName);
1727 * @param mixed $value, ...
1728 * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
1729 * @since Method available since Release 3.0.0
1731 function onConsecutiveCalls()
1733 return PHPUnit_Framework_TestCase::onConsecutiveCalls();
1737 * Returns a matcher that matches when the method it is evaluated for
1738 * is executed exactly once.
1740 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1741 * @since Method available since Release 3.0.0
1745 return PHPUnit_Framework_TestCase::once();
1751 * @param integer $argumentIndex
1752 * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
1753 * @since Method available since Release 3.3.0
1755 function returnArgument($argumentIndex)
1757 return PHPUnit_Framework_TestCase::returnArgument($argumentIndex);
1763 * @param mixed $callback
1764 * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
1765 * @since Method available since Release 3.3.0
1767 function returnCallback($callback)
1769 return PHPUnit_Framework_TestCase::returnCallback($callback);
1775 * @param mixed $value
1776 * @return PHPUnit_Framework_MockObject_Stub_Return
1777 * @since Method available since Release 3.0.0
1779 function returnValue($value)
1781 return PHPUnit_Framework_TestCase::returnValue($value);
1785 * Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
1787 * @param string $string
1788 * @param boolean $case
1789 * @return PHPUnit_Framework_Constraint_StringContains
1790 * @since Method available since Release 3.0.0
1792 function stringContains($string, $case = TRUE)
1794 return PHPUnit_Framework_Assert::stringContains($string, $case);
1798 * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
1800 * @param mixed $suffix
1801 * @return PHPUnit_Framework_Constraint_StringEndsWith
1802 * @since Method available since Release 3.4.0
1804 function stringEndsWith($suffix)
1806 return PHPUnit_Framework_Assert::stringEndsWith($suffix);
1810 * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
1812 * @param mixed $prefix
1813 * @return PHPUnit_Framework_Constraint_StringStartsWith
1814 * @since Method available since Release 3.4.0
1816 function stringStartsWith($prefix)
1818 return PHPUnit_Framework_Assert::stringStartsWith($prefix);
1824 * @param Exception $exception
1825 * @return PHPUnit_Framework_MockObject_Stub_Exception
1826 * @since Method available since Release 3.1.0
1828 function throwException(Exception $exception)
1830 return PHPUnit_Framework_TestCase::throwException($exception);