]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/PHPUnit/PHPUnit/Framework/Assert/Functions.php
Release 6.2.0
[Github/sugarcrm.git] / tests / PHPUnit / PHPUnit / Framework / Assert / Functions.php
1 <?php
2 /**
3  * PHPUnit
4  *
5  * Copyright (c) 2002-2011, Sebastian Bergmann <sebastian@phpunit.de>.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  *   * Redistributions of source code must retain the above copyright
13  *     notice, this list of conditions and the following disclaimer.
14  *
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
18  *     distribution.
19  *
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.
23  *
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.
36  *
37  * @package    PHPUnit
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
44  */
45
46 /**
47  * Returns a matcher that matches when the method it is evaluated for
48  * is executed zero or more times.
49  *
50  * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
51  * @since  Method available since Release 3.0.0
52  */
53 function any()
54 {
55     return PHPUnit_Framework_TestCase::any();
56 }
57
58 /**
59  * Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
60  *
61  * @return PHPUnit_Framework_Constraint_IsAnything
62  * @since  Method available since Release 3.0.0
63  */
64 function anything()
65 {
66     return PHPUnit_Framework_Assert::anything();
67 }
68
69 /**
70  * Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
71  *
72  * @param  mixed $key
73  * @return PHPUnit_Framework_Constraint_ArrayHasKey
74  * @since  Method available since Release 3.0.0
75  */
76 function arrayHasKey($key)
77 {
78     return PHPUnit_Framework_Assert::arrayHasKey($key);
79 }
80
81 /**
82  * Asserts that an array has a specified key.
83  *
84  * @param  mixed  $key
85  * @param  array  $array
86  * @param  string $message
87  * @since  Method available since Release 3.0.0
88  */
89 function assertArrayHasKey($key, array $array, $message = '')
90 {
91     return PHPUnit_Framework_Assert::assertArrayHasKey($key, $array, $message);
92 }
93
94 /**
95  * Asserts that an array does not have a specified key.
96  *
97  * @param  mixed  $key
98  * @param  array  $array
99  * @param  string $message
100  * @since  Method available since Release 3.0.0
101  */
102 function assertArrayNotHasKey($key, array $array, $message = '')
103 {
104     return PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $array, $message);
105 }
106
107 /**
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.
110  *
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
117  */
118 function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE)
119 {
120     return PHPUnit_Framework_Assert::assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message, $ignoreCase);
121 }
122
123 /**
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.
126  *
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
133  */
134 function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '')
135 {
136     return PHPUnit_Framework_Assert::assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType, $message);
137 }
138
139 /**
140  * Asserts that a static attribute of a class or an attribute of an object
141  * is empty.
142  *
143  * @param string $haystackAttributeName
144  * @param mixed  $haystackClassOrObject
145  * @param string $message
146  * @since Method available since Release 3.5.0
147  */
148 function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
149 {
150     return PHPUnit_Framework_Assert::assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message);
151 }
152
153 /**
154  * Asserts that a variable is equal to an attribute of an object.
155  *
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
164  */
165 function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
166 {
167     return PHPUnit_Framework_Assert::assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
168 }
169
170 /**
171  * Asserts that an attribute is greater than another value.
172  *
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
178  */
179 function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
180 {
181     return PHPUnit_Framework_Assert::assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message);
182 }
183
184 /**
185  * Asserts that an attribute is greater than or equal to another value.
186  *
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
192  */
193 function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
194 {
195     return PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message);
196 }
197
198 /**
199  * Asserts that an attribute is of a given type.
200  *
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
206  */
207 function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')
208 {
209     return PHPUnit_Framework_Assert::assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message);
210 }
211
212 /**
213  * Asserts that an attribute is of a given type.
214  *
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
220  */
221 function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '')
222 {
223     return PHPUnit_Framework_Assert::assertAttributeInternalType($expected, $attributeName, $classOrObject, $message);
224 }
225
226 /**
227  * Asserts that an attribute is smaller than another value.
228  *
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
234  */
235 function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
236 {
237     return PHPUnit_Framework_Assert::assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message);
238 }
239
240 /**
241  * Asserts that an attribute is smaller than or equal to another value.
242  *
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
248  */
249 function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
250 {
251     return PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message);
252 }
253
254 /**
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.
257  *
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
264  */
265 function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = FALSE)
266 {
267     return PHPUnit_Framework_Assert::assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message, $ignoreCase);
268 }
269
270 /**
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
273  * type.
274  *
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
281  */
282 function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = NULL, $message = '')
283 {
284     return PHPUnit_Framework_Assert::assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType, $message);
285 }
286
287 /**
288  * Asserts that a static attribute of a class or an attribute of an object
289  * is not empty.
290  *
291  * @param string $haystackAttributeName
292  * @param mixed  $haystackClassOrObject
293  * @param string $message
294  * @since Method available since Release 3.5.0
295  */
296 function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
297 {
298     return PHPUnit_Framework_Assert::assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message);
299 }
300
301 /**
302  * Asserts that a variable is not equal to an attribute of an object.
303  *
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
312  */
313 function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
314 {
315     return PHPUnit_Framework_Assert::assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
316 }
317
318 /**
319  * Asserts that an attribute is of a given type.
320  *
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
326  */
327 function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '')
328 {
329     return PHPUnit_Framework_Assert::assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message);
330 }
331
332 /**
333  * Asserts that an attribute is of a given type.
334  *
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
340  */
341 function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '')
342 {
343     return PHPUnit_Framework_Assert::assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message);
344 }
345
346 /**
347  * Asserts that a variable and an attribute of an object do not have the
348  * same type and value.
349  *
350  * @param  mixed  $expected
351  * @param  string $actualAttributeName
352  * @param  object $actualClassOrObject
353  * @param  string $message
354  */
355 function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
356 {
357     return PHPUnit_Framework_Assert::assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message);
358 }
359
360 /**
361  * Asserts that an attribute is of a given type.
362  *
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
368  */
369 function assertAttributeNotType($expected, $attributeName, $classOrObject, $message = '')
370 {
371     return PHPUnit_Framework_Assert::assertAttributeNotType($expected, $attributeName, $classOrObject, $message);
372 }
373
374 /**
375  * Asserts that a variable and an attribute of an object have the same type
376  * and value.
377  *
378  * @param  mixed  $expected
379  * @param  string $actualAttributeName
380  * @param  object $actualClassOrObject
381  * @param  string $message
382  */
383 function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
384 {
385     return PHPUnit_Framework_Assert::assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message);
386 }
387
388 /**
389  * Asserts that an attribute is of a given type.
390  *
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
396  */
397 function assertAttributeType($expected, $attributeName, $classOrObject, $message = '')
398 {
399     return PHPUnit_Framework_Assert::assertAttributeType($expected, $attributeName, $classOrObject, $message);
400 }
401
402 /**
403  * Asserts that a class has a specified attribute.
404  *
405  * @param  string $attributeName
406  * @param  string $className
407  * @param  string $message
408  * @since  Method available since Release 3.1.0
409  */
410 function assertClassHasAttribute($attributeName, $className, $message = '')
411 {
412     return PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $className, $message);
413 }
414
415 /**
416  * Asserts that a class has a specified static attribute.
417  *
418  * @param  string $attributeName
419  * @param  string $className
420  * @param  string $message
421  * @since  Method available since Release 3.1.0
422  */
423 function assertClassHasStaticAttribute($attributeName, $className, $message = '')
424 {
425     return PHPUnit_Framework_Assert::assertClassHasStaticAttribute($attributeName, $className, $message);
426 }
427
428 /**
429  * Asserts that a class does not have a specified attribute.
430  *
431  * @param  string $attributeName
432  * @param  string $className
433  * @param  string $message
434  * @since  Method available since Release 3.1.0
435  */
436 function assertClassNotHasAttribute($attributeName, $className, $message = '')
437 {
438     return PHPUnit_Framework_Assert::assertClassNotHasAttribute($attributeName, $className, $message);
439 }
440
441 /**
442  * Asserts that a class does not have a specified static attribute.
443  *
444  * @param  string $attributeName
445  * @param  string $className
446  * @param  string $message
447  * @since  Method available since Release 3.1.0
448  */
449 function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
450 {
451     return PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute($attributeName, $className, $message);
452 }
453
454 /**
455  * Asserts that a haystack contains a needle.
456  *
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
462  */
463 function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
464 {
465     return PHPUnit_Framework_Assert::assertContains($needle, $haystack, $message, $ignoreCase);
466 }
467
468 /**
469  * Asserts that a haystack contains only values of a given type.
470  *
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
476  */
477 function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
478 {
479     return PHPUnit_Framework_Assert::assertContainsOnly($type, $haystack, $isNativeType, $message);
480 }
481
482 /**
483  * Asserts that a variable is empty.
484  *
485  * @param  mixed   $actual
486  * @param  string  $message
487  * @throws PHPUnit_Framework_AssertionFailedError
488  */
489 function assertEmpty($actual, $message = '')
490 {
491     return PHPUnit_Framework_Assert::assertEmpty($actual, $message);
492 }
493
494 /**
495  * Asserts that a hierarchy of DOMNodes matches.
496  *
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
503  */
504 function assertEqualXMLStructure(DOMNode $expectedNode, DOMNode $actualNode, $checkAttributes = FALSE, $message = '')
505 {
506     return PHPUnit_Framework_Assert::assertEqualXMLStructure($expectedNode, $actualNode, $checkAttributes, $message);
507 }
508
509 /**
510  * Asserts that two variables are equal.
511  *
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
519  */
520 function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
521 {
522     return PHPUnit_Framework_Assert::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
523 }
524
525 /**
526  * Asserts that a condition is false.
527  *
528  * @param  boolean  $condition
529  * @param  string   $message
530  * @throws PHPUnit_Framework_AssertionFailedError
531  */
532 function assertFalse($condition, $message = '')
533 {
534     return PHPUnit_Framework_Assert::assertFalse($condition, $message);
535 }
536
537 /**
538  * Asserts that the contents of one file is equal to the contents of another
539  * file.
540  *
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
547  */
548 function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
549 {
550     return PHPUnit_Framework_Assert::assertFileEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
551 }
552
553 /**
554  * Asserts that a file exists.
555  *
556  * @param  string $filename
557  * @param  string $message
558  * @since  Method available since Release 3.0.0
559  */
560 function assertFileExists($filename, $message = '')
561 {
562     return PHPUnit_Framework_Assert::assertFileExists($filename, $message);
563 }
564
565 /**
566  * Asserts that the contents of one file is not equal to the contents of
567  * another file.
568  *
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
575  */
576 function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
577 {
578     return PHPUnit_Framework_Assert::assertFileNotEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
579 }
580
581 /**
582  * Asserts that a file does not exist.
583  *
584  * @param  string $filename
585  * @param  string $message
586  * @since  Method available since Release 3.0.0
587  */
588 function assertFileNotExists($filename, $message = '')
589 {
590     return PHPUnit_Framework_Assert::assertFileNotExists($filename, $message);
591 }
592
593 /**
594  * Asserts that a value is greater than another value.
595  *
596  * @param  mixed   $expected
597  * @param  mixed   $actual
598  * @param  string  $message
599  * @since  Method available since Release 3.1.0
600  */
601 function assertGreaterThan($expected, $actual, $message = '')
602 {
603     return PHPUnit_Framework_Assert::assertGreaterThan($expected, $actual, $message);
604 }
605
606 /**
607  * Asserts that a value is greater than or equal to another value.
608  *
609  * @param  mixed   $expected
610  * @param  mixed   $actual
611  * @param  string  $message
612  * @since  Method available since Release 3.1.0
613  */
614 function assertGreaterThanOrEqual($expected, $actual, $message = '')
615 {
616     return PHPUnit_Framework_Assert::assertGreaterThanOrEqual($expected, $actual, $message);
617 }
618
619 /**
620  * Asserts that a variable is of a given type.
621  *
622  * @param string $expected
623  * @param mixed  $actual
624  * @param string $message
625  * @since Method available since Release 3.5.0
626  */
627 function assertInstanceOf($expected, $actual, $message = '')
628 {
629     return PHPUnit_Framework_Assert::assertInstanceOf($expected, $actual, $message);
630 }
631
632 /**
633  * Asserts that a variable is of a given type.
634  *
635  * @param string $expected
636  * @param mixed  $actual
637  * @param string $message
638  * @since Method available since Release 3.5.0
639  */
640 function assertInternalType($expected, $actual, $message = '')
641 {
642     return PHPUnit_Framework_Assert::assertInternalType($expected, $actual, $message);
643 }
644
645 /**
646  * Asserts that a value is smaller than another value.
647  *
648  * @param  mixed   $expected
649  * @param  mixed   $actual
650  * @param  string  $message
651  * @since  Method available since Release 3.1.0
652  */
653 function assertLessThan($expected, $actual, $message = '')
654 {
655     return PHPUnit_Framework_Assert::assertLessThan($expected, $actual, $message);
656 }
657
658 /**
659  * Asserts that a value is smaller than or equal to another value.
660  *
661  * @param  mixed   $expected
662  * @param  mixed   $actual
663  * @param  string  $message
664  * @since  Method available since Release 3.1.0
665  */
666 function assertLessThanOrEqual($expected, $actual, $message = '')
667 {
668     return PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $message);
669 }
670
671 /**
672  * Asserts that a haystack does not contain a needle.
673  *
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
679  */
680 function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
681 {
682     return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase);
683 }
684
685 /**
686  * Asserts that a haystack does not contain only values of a given type.
687  *
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
693  */
694 function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
695 {
696     return PHPUnit_Framework_Assert::assertNotContainsOnly($type, $haystack, $isNativeType, $message);
697 }
698
699 /**
700  * Asserts that a variable is not empty.
701  *
702  * @param  mixed   $actual
703  * @param  string  $message
704  * @throws PHPUnit_Framework_AssertionFailedError
705  */
706 function assertNotEmpty($actual, $message = '')
707 {
708     return PHPUnit_Framework_Assert::assertNotEmpty($actual, $message);
709 }
710
711 /**
712  * Asserts that two variables are not equal.
713  *
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
722  */
723 function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
724 {
725     return PHPUnit_Framework_Assert::assertNotEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
726 }
727
728 /**
729  * Asserts that a variable is not of a given type.
730  *
731  * @param string $expected
732  * @param mixed  $actual
733  * @param string $message
734  * @since Method available since Release 3.5.0
735  */
736 function assertNotInstanceOf($expected, $actual, $message = '')
737 {
738     return PHPUnit_Framework_Assert::assertNotInstanceOf($expected, $actual, $message);
739 }
740
741 /**
742  * Asserts that a variable is not of a given type.
743  *
744  * @param string $expected
745  * @param mixed  $actual
746  * @param string $message
747  * @since Method available since Release 3.5.0
748  */
749 function assertNotInternalType($expected, $actual, $message = '')
750 {
751     return PHPUnit_Framework_Assert::assertNotInternalType($expected, $actual, $message);
752 }
753
754 /**
755  * Asserts that a variable is not NULL.
756  *
757  * @param  mixed  $actual
758  * @param  string $message
759  */
760 function assertNotNull($actual, $message = '')
761 {
762     return PHPUnit_Framework_Assert::assertNotNull($actual, $message);
763 }
764
765 /**
766  * Asserts that a string does not match a given regular expression.
767  *
768  * @param  string $pattern
769  * @param  string $string
770  * @param  string $message
771  * @since  Method available since Release 2.1.0
772  */
773 function assertNotRegExp($pattern, $string, $message = '')
774 {
775     return PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
776 }
777
778 /**
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
781  * the same object.
782  *
783  * @param  mixed  $expected
784  * @param  mixed  $actual
785  * @param  string $message
786  */
787 function assertNotSame($expected, $actual, $message = '')
788 {
789     return PHPUnit_Framework_Assert::assertNotSame($expected, $actual, $message);
790 }
791
792 /**
793  * This assertion is the exact opposite of assertTag().
794  *
795  * Rather than asserting that $matcher results in a match, it asserts that
796  * $matcher does not match.
797  *
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>
805  */
806 function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE)
807 {
808     return PHPUnit_Framework_Assert::assertNotTag($matcher, $actual, $message, $isHtml);
809 }
810
811 /**
812  * Asserts that a variable is not of a given type.
813  *
814  * @param  string $expected
815  * @param  mixed  $actual
816  * @param  string $message
817  * @since  Method available since Release 2.2.0
818  */
819 function assertNotType($expected, $actual, $message = '')
820 {
821     return PHPUnit_Framework_Assert::assertNotType($expected, $actual, $message);
822 }
823
824 /**
825  * Asserts that a variable is NULL.
826  *
827  * @param  mixed  $actual
828  * @param  string $message
829  */
830 function assertNull($actual, $message = '')
831 {
832     return PHPUnit_Framework_Assert::assertNull($actual, $message);
833 }
834
835 /**
836  * Asserts that an object has a specified attribute.
837  *
838  * @param  string $attributeName
839  * @param  object $object
840  * @param  string $message
841  * @since  Method available since Release 3.0.0
842  */
843 function assertObjectHasAttribute($attributeName, $object, $message = '')
844 {
845     return PHPUnit_Framework_Assert::assertObjectHasAttribute($attributeName, $object, $message);
846 }
847
848 /**
849  * Asserts that an object does not have a specified attribute.
850  *
851  * @param  string $attributeName
852  * @param  object $object
853  * @param  string $message
854  * @since  Method available since Release 3.0.0
855  */
856 function assertObjectNotHasAttribute($attributeName, $object, $message = '')
857 {
858     return PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $object, $message);
859 }
860
861 /**
862  * Asserts that a string matches a given regular expression.
863  *
864  * @param  string $pattern
865  * @param  string $string
866  * @param  string $message
867  */
868 function assertRegExp($pattern, $string, $message = '')
869 {
870     return PHPUnit_Framework_Assert::assertRegExp($pattern, $string, $message);
871 }
872
873 /**
874  * Asserts that two variables have the same type and value.
875  * Used on objects, it asserts that two variables reference
876  * the same object.
877  *
878  * @param  mixed  $expected
879  * @param  mixed  $actual
880  * @param  string $message
881  */
882 function assertSame($expected, $actual, $message = '')
883 {
884     return PHPUnit_Framework_Assert::assertSame($expected, $actual, $message);
885 }
886
887 /**
888  * Assert the presence, absence, or count of elements in a document matching
889  * the CSS $selector, regardless of the contents of those elements.
890  *
891  * The first argument, $selector, is the CSS selector used to match
892  * the elements in the $actual document.
893  *
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.
898  *
899  * assertSelectCount("#binder", true, $xml);  // any?
900  * assertSelectCount(".binder", 3, $xml); // exactly 3?
901  *
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>
910  */
911 function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE)
912 {
913     return PHPUnit_Framework_Assert::assertSelectCount($selector, $count, $actual, $message, $isHtml);
914 }
915
916 /**
917  * assertSelectEquals("#binder .name", "Chuck", true,  $xml);  // any?
918  * assertSelectEquals("#binder .name", "Chuck", false, $xml);  // none?
919  *
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>
929  */
930 function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE)
931 {
932     return PHPUnit_Framework_Assert::assertSelectEquals($selector, $content, $count, $actual, $message, $isHtml);
933 }
934
935 /**
936  * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
937  * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
938  *
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>
948  */
949 function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE)
950 {
951     return PHPUnit_Framework_Assert::assertSelectRegExp($selector, $pattern, $count, $actual, $message, $isHtml);
952 }
953
954 /**
955  * Asserts that a string ends not with a given prefix.
956  *
957  * @param  string $suffix
958  * @param  string $string
959  * @param  string $message
960  * @since  Method available since Release 3.4.0
961  */
962 function assertStringEndsNotWith($suffix, $string, $message = '')
963 {
964     return PHPUnit_Framework_Assert::assertStringEndsNotWith($suffix, $string, $message);
965 }
966
967 /**
968  * Asserts that a string ends with a given prefix.
969  *
970  * @param  string $suffix
971  * @param  string $string
972  * @param  string $message
973  * @since  Method available since Release 3.4.0
974  */
975 function assertStringEndsWith($suffix, $string, $message = '')
976 {
977     return PHPUnit_Framework_Assert::assertStringEndsWith($suffix, $string, $message);
978 }
979
980 /**
981  * Asserts that the contents of a string is equal
982  * to the contents of a file.
983  *
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
990  */
991 function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
992 {
993     return PHPUnit_Framework_Assert::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
994 }
995
996 /**
997  * Asserts that a string matches a given format string.
998  *
999  * @param  string $format
1000  * @param  string $string
1001  * @param  string $message
1002  * @since  Method available since Release 3.5.0
1003  */
1004 function assertStringMatchesFormat($format, $string, $message = '')
1005 {
1006     return PHPUnit_Framework_Assert::assertStringMatchesFormat($format, $string, $message);
1007 }
1008
1009 /**
1010  * Asserts that a string matches a given format file.
1011  *
1012  * @param  string $formatFile
1013  * @param  string $string
1014  * @param  string $message
1015  * @since  Method available since Release 3.5.0
1016  */
1017 function assertStringMatchesFormatFile($formatFile, $string, $message = '')
1018 {
1019     return PHPUnit_Framework_Assert::assertStringMatchesFormatFile($formatFile, $string, $message);
1020 }
1021
1022 /**
1023  * Asserts that the contents of a string is not equal
1024  * to the contents of a file.
1025  *
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
1032  */
1033 function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
1034 {
1035     return PHPUnit_Framework_Assert::assertStringNotEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
1036 }
1037
1038 /**
1039  * Asserts that a string does not match a given format string.
1040  *
1041  * @param  string $format
1042  * @param  string $string
1043  * @param  string $message
1044  * @since  Method available since Release 3.5.0
1045  */
1046 function assertStringNotMatchesFormat($format, $string, $message = '')
1047 {
1048     return PHPUnit_Framework_Assert::assertStringNotMatchesFormat($format, $string, $message);
1049 }
1050
1051 /**
1052  * Asserts that a string does not match a given format string.
1053  *
1054  * @param  string $formatFile
1055  * @param  string $string
1056  * @param  string $message
1057  * @since  Method available since Release 3.5.0
1058  */
1059 function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
1060 {
1061     return PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile($formatFile, $string, $message);
1062 }
1063
1064 /**
1065  * Asserts that a string starts not with a given prefix.
1066  *
1067  * @param  string $prefix
1068  * @param  string $string
1069  * @param  string $message
1070  * @since  Method available since Release 3.4.0
1071  */
1072 function assertStringStartsNotWith($prefix, $string, $message = '')
1073 {
1074     return PHPUnit_Framework_Assert::assertStringStartsNotWith($prefix, $string, $message);
1075 }
1076
1077 /**
1078  * Asserts that a string starts with a given prefix.
1079  *
1080  * @param  string $prefix
1081  * @param  string $string
1082  * @param  string $message
1083  * @since  Method available since Release 3.4.0
1084  */
1085 function assertStringStartsWith($prefix, $string, $message = '')
1086 {
1087     return PHPUnit_Framework_Assert::assertStringStartsWith($prefix, $string, $message);
1088 }
1089
1090 /**
1091  * Evaluate an HTML or XML string and assert its structure and/or contents.
1092  *
1093  * The first argument ($matcher) is an associative array that specifies the
1094  * match criteria for the assertion:
1095  *
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.
1111  * Accepts the keys:
1112  *- `count`: a number which must equal the number of children
1113  *   that match
1114  *- `less_than`: the number of matching children must be greater
1115  *   than this number
1116  *- `greater_than` : the number of matching children must be less than
1117  *   this number
1118  *- `only` : another hash consisting of the keys to use to match
1119  *   on the children, and only matching children will be
1120  *   counted
1121  *
1122  * <code>
1123  * // Matcher that asserts that there is an element with an id="my_id".
1124  * $matcher = array('id' => 'my_id');
1125  *
1126  * // Matcher that asserts that there is a "span" tag.
1127  * $matcher = array('tag' => 'span');
1128  *
1129  * // Matcher that asserts that there is a "span" tag with the content
1130  * // "Hello World".
1131  * $matcher = array('tag' => 'span', 'content' => 'Hello World');
1132  *
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)/');
1136  *
1137  * // Matcher that asserts that there is a "span" with an "list" class
1138  * // attribute.
1139  * $matcher = array(
1140  *   'tag'=> 'span',
1141  *   'attributes' => array('class' => 'list')
1142  * );
1143  *
1144  * // Matcher that asserts that there is a "span" inside of a "div".
1145  * $matcher = array(
1146  *   'tag'=> 'span',
1147  *   'parent' => array('tag' => 'div')
1148  * );
1149  *
1150  * // Matcher that asserts that there is a "span" somewhere inside a
1151  * // "table".
1152  * $matcher = array(
1153  *   'tag'  => 'span',
1154  *   'ancestor' => array('tag' => 'table')
1155  * );
1156  *
1157  * // Matcher that asserts that there is a "span" with at least one "em"
1158  * // child.
1159  * $matcher = array(
1160  *   'tag'   => 'span',
1161  *   'child' => array('tag' => 'em')
1162  * );
1163  *
1164  * // Matcher that asserts that there is a "span" containing a (possibly
1165  * // nested) "strong" tag.
1166  * $matcher = array(
1167  *   'tag'=> 'span',
1168  *   'descendant' => array('tag' => 'strong')
1169  * );
1170  *
1171  * // Matcher that asserts that there is a "span" containing 5-10 "em" tags
1172  * // as immediate children.
1173  * $matcher = array(
1174  *   'tag'  => 'span',
1175  *   'children' => array(
1176  * 'less_than'=> 11,
1177  * 'greater_than' => 4,
1178  * 'only' => array('tag' => 'em')
1179  *   )
1180  * );
1181  *
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".
1185  * $matcher = array(
1186  *   'tag'=> 'div',
1187  *   'ancestor'   => array('tag' => 'ul'),
1188  *   'parent' => array(
1189  * 'tag'=> 'li',
1190  * 'attributes' => array('class' => 'enum')
1191  *   ),
1192  *   'descendant' => array(
1193  * 'tag'   => 'span',
1194  * 'child' => array(
1195  *   'id'  => 'my_test',
1196  *   'content' => 'Hello World'
1197  * )
1198  *   )
1199  * );
1200  *
1201  * // Use assertTag() to apply a $matcher to a piece of $html.
1202  * $this->assertTag($matcher, $html);
1203  *
1204  * // Use assertTag() to apply a $matcher to a piece of $xml.
1205  * $this->assertTag($matcher, $xml, '', FALSE);
1206  * </code>
1207  *
1208  * The second argument ($actual) is a string containing either HTML or
1209  * XML text to be tested.
1210  *
1211  * The third argument ($message) is an optional message that will be
1212  * used if the assertion fails.
1213  *
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.
1218  *
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>
1226  */
1227 function assertTag($matcher, $actual, $message = '', $isHtml = TRUE)
1228 {
1229     return PHPUnit_Framework_Assert::assertTag($matcher, $actual, $message, $isHtml);
1230 }
1231
1232 /**
1233  * Evaluates a PHPUnit_Framework_Constraint matcher object.
1234  *
1235  * @param  mixed$value
1236  * @param  PHPUnit_Framework_Constraint $constraint
1237  * @param  string   $message
1238  * @since  Method available since Release 3.0.0
1239  */
1240 function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
1241 {
1242     return PHPUnit_Framework_Assert::assertThat($value, $constraint, $message);
1243 }
1244
1245 /**
1246  * Asserts that a condition is true.
1247  *
1248  * @param  boolean $condition
1249  * @param  string  $message
1250  * @throws PHPUnit_Framework_AssertionFailedError
1251  */
1252 function assertTrue($condition, $message = '')
1253 {
1254     return PHPUnit_Framework_Assert::assertTrue($condition, $message);
1255 }
1256
1257 /**
1258  * Asserts that a variable is of a given type.
1259  *
1260  * @param  string $expected
1261  * @param  mixed  $actual
1262  * @param  string $message
1263  */
1264 function assertType($expected, $actual, $message = '')
1265 {
1266     return PHPUnit_Framework_Assert::assertType($expected, $actual, $message);
1267 }
1268
1269 /**
1270  * Asserts that two XML files are equal.
1271  *
1272  * @param  string $expectedFile
1273  * @param  string $actualFile
1274  * @param  string $message
1275  * @since  Method available since Release 3.1.0
1276  */
1277 function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
1278 {
1279     return PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message);
1280 }
1281
1282 /**
1283  * Asserts that two XML files are not equal.
1284  *
1285  * @param  string $expectedFile
1286  * @param  string $actualFile
1287  * @param  string $message
1288  * @since  Method available since Release 3.1.0
1289  */
1290 function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
1291 {
1292     return PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message);
1293 }
1294
1295 /**
1296  * Asserts that two XML documents are equal.
1297  *
1298  * @param  string $expectedFile
1299  * @param  string $actualXml
1300  * @param  string $message
1301  * @since  Method available since Release 3.3.0
1302  */
1303 function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
1304 {
1305     return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message);
1306 }
1307
1308 /**
1309  * Asserts that two XML documents are equal.
1310  *
1311  * @param  string $expectedXml
1312  * @param  string $actualXml
1313  * @param  string $message
1314  * @since  Method available since Release 3.1.0
1315  */
1316 function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
1317 {
1318     return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message);
1319 }
1320
1321 /**
1322  * Asserts that two XML documents are not equal.
1323  *
1324  * @param  string $expectedFile
1325  * @param  string $actualXml
1326  * @param  string $message
1327  * @since  Method available since Release 3.3.0
1328  */
1329 function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
1330 {
1331     return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message);
1332 }
1333
1334 /**
1335  * Asserts that two XML documents are not equal.
1336  *
1337  * @param  string $expectedXml
1338  * @param  string $actualXml
1339  * @param  string $message
1340  * @since  Method available since Release 3.1.0
1341  */
1342 function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
1343 {
1344     return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message);
1345 }
1346
1347 /**
1348  * Returns a matcher that matches when the method it is evaluated for
1349  * is invoked at the given $index.
1350  *
1351  * @param  integer $index
1352  * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
1353  * @since  Method available since Release 3.0.0
1354  */
1355 function at($index)
1356 {
1357     return PHPUnit_Framework_TestCase::at($index);
1358 }
1359
1360 /**
1361  * Returns a matcher that matches when the method it is evaluated for
1362  * is executed at least once.
1363  *
1364  * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
1365  * @since  Method available since Release 3.0.0
1366  */
1367 function atLeastOnce()
1368 {
1369     return PHPUnit_Framework_TestCase::atLeastOnce();
1370 }
1371
1372 /**
1373  * Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
1374  *
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
1379  */
1380 function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
1381 {
1382     return PHPUnit_Framework_Assert::attribute($constraint, $attributeName);
1383 }
1384
1385 /**
1386  * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
1387  * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
1388  * object.
1389  *
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
1398  */
1399 function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1400 {
1401     return PHPUnit_Framework_Assert::attributeEqualTo($attributeName, $value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1402 }
1403
1404 /**
1405  * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
1406  *
1407  * @param  string $attributeName
1408  * @return PHPUnit_Framework_Constraint_ClassHasAttribute
1409  * @since  Method available since Release 3.1.0
1410  */
1411 function classHasAttribute($attributeName)
1412 {
1413     return PHPUnit_Framework_Assert::classHasAttribute($attributeName);
1414 }
1415
1416 /**
1417  * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
1418  * object.
1419  *
1420  * @param  string $attributeName
1421  * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
1422  * @since  Method available since Release 3.1.0
1423  */
1424 function classHasStaticAttribute($attributeName)
1425 {
1426     return PHPUnit_Framework_Assert::classHasStaticAttribute($attributeName);
1427 }
1428
1429 /**
1430  * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
1431  * object.
1432  *
1433  * @param  mixed $value
1434  * @return PHPUnit_Framework_Constraint_TraversableContains
1435  * @since  Method available since Release 3.0.0
1436  */
1437 function contains($value)
1438 {
1439     return PHPUnit_Framework_Assert::contains($value);
1440 }
1441
1442 /**
1443  * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1444  * object.
1445  *
1446  * @param  string $type
1447  * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1448  * @since  Method available since Release 3.1.4
1449  */
1450 function containsOnly($type)
1451 {
1452     return PHPUnit_Framework_Assert::containsOnly($type);
1453 }
1454
1455 /**
1456  * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
1457  *
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
1465  */
1466 function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1467 {
1468     return PHPUnit_Framework_Assert::equalTo($value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1469 }
1470
1471 /**
1472  * Returns a matcher that matches when the method it is evaluated for
1473  * is executed exactly $count times.
1474  *
1475  * @param  integer $count
1476  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1477  * @since  Method available since Release 3.0.0
1478  */
1479 function exactly($count)
1480 {
1481     return PHPUnit_Framework_TestCase::exactly($count);
1482 }
1483
1484 /**
1485  * Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
1486  *
1487  * @return PHPUnit_Framework_Constraint_FileExists
1488  * @since  Method available since Release 3.0.0
1489  */
1490 function fileExists()
1491 {
1492     return PHPUnit_Framework_Assert::fileExists();
1493 }
1494
1495 /**
1496  * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
1497  *
1498  * @param  mixed $value
1499  * @return PHPUnit_Framework_Constraint_GreaterThan
1500  * @since  Method available since Release 3.0.0
1501  */
1502 function greaterThan($value)
1503 {
1504     return PHPUnit_Framework_Assert::greaterThan($value);
1505 }
1506
1507 /**
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.
1511  *
1512  * @param  mixed $value
1513  * @return PHPUnit_Framework_Constraint_Or
1514  * @since  Method available since Release 3.1.0
1515  */
1516 function greaterThanOrEqual($value)
1517 {
1518     return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
1519 }
1520
1521 /**
1522  * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
1523  *
1524  * @param  mixed $value
1525  * @return PHPUnit_Framework_Constraint_IsIdentical
1526  * @since  Method available since Release 3.0.0
1527  */
1528 function identicalTo($value)
1529 {
1530     return PHPUnit_Framework_Assert::identicalTo($value);
1531 }
1532
1533 /**
1534  * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
1535  *
1536  * @return PHPUnit_Framework_Constraint_IsEmpty
1537  * @since  Method available since Release 3.5.0
1538  */
1539 function isEmpty()
1540 {
1541     return PHPUnit_Framework_Assert::isEmpty();
1542 }
1543
1544 /**
1545  * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
1546  *
1547  * @return PHPUnit_Framework_Constraint_IsFalse
1548  * @since  Method available since Release 3.3.0
1549  */
1550 function isFalse()
1551 {
1552     return PHPUnit_Framework_Assert::isFalse();
1553 }
1554
1555 /**
1556  * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
1557  *
1558  * @param  string $className
1559  * @return PHPUnit_Framework_Constraint_IsInstanceOf
1560  * @since  Method available since Release 3.0.0
1561  */
1562 function isInstanceOf($className)
1563 {
1564     return PHPUnit_Framework_Assert::isInstanceOf($className);
1565 }
1566
1567 /**
1568  * Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
1569  *
1570  * @return PHPUnit_Framework_Constraint_IsNull
1571  * @since  Method available since Release 3.3.0
1572  */
1573 function isNull()
1574 {
1575     return PHPUnit_Framework_Assert::isNull();
1576 }
1577
1578 /**
1579  * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
1580  *
1581  * @return PHPUnit_Framework_Constraint_IsTrue
1582  * @since  Method available since Release 3.3.0
1583  */
1584 function isTrue()
1585 {
1586     return PHPUnit_Framework_Assert::isTrue();
1587 }
1588
1589 /**
1590  * Returns a PHPUnit_Framework_Constraint_IsType matcher object.
1591  *
1592  * @param  string $type
1593  * @return PHPUnit_Framework_Constraint_IsType
1594  * @since  Method available since Release 3.0.0
1595  */
1596 function isType($type)
1597 {
1598     return PHPUnit_Framework_Assert::isType($type);
1599 }
1600
1601 /**
1602  * Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
1603  *
1604  * @param  mixed $value
1605  * @return PHPUnit_Framework_Constraint_LessThan
1606  * @since  Method available since Release 3.0.0
1607  */
1608 function lessThan($value)
1609 {
1610     return PHPUnit_Framework_Assert::lessThan($value);
1611 }
1612
1613 /**
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.
1617  *
1618  * @param  mixed $value
1619  * @return PHPUnit_Framework_Constraint_Or
1620  * @since  Method available since Release 3.1.0
1621  */
1622 function lessThanOrEqual($value)
1623 {
1624     return PHPUnit_Framework_Assert::lessThanOrEqual($value);
1625 }
1626
1627 /**
1628  * Returns a PHPUnit_Framework_Constraint_And matcher object.
1629  *
1630  * @return PHPUnit_Framework_Constraint_And
1631  * @since  Method available since Release 3.0.0
1632  */
1633 function logicalAnd()
1634 {
1635     return PHPUnit_Framework_Assert::logicalAnd();
1636 }
1637
1638 /**
1639  * Returns a PHPUnit_Framework_Constraint_Not matcher object.
1640  *
1641  * @param  PHPUnit_Framework_Constraint $constraint
1642  * @return PHPUnit_Framework_Constraint_Not
1643  * @since  Method available since Release 3.0.0
1644  */
1645 function logicalNot(PHPUnit_Framework_Constraint $constraint)
1646 {
1647     return PHPUnit_Framework_Assert::logicalNot($constraint);
1648 }
1649
1650 /**
1651  * Returns a PHPUnit_Framework_Constraint_Or matcher object.
1652  *
1653  * @return PHPUnit_Framework_Constraint_Or
1654  * @since  Method available since Release 3.0.0
1655  */
1656 function logicalOr()
1657 {
1658     return PHPUnit_Framework_Assert::logicalOr();
1659 }
1660
1661 /**
1662  * Returns a PHPUnit_Framework_Constraint_Xor matcher object.
1663  *
1664  * @return PHPUnit_Framework_Constraint_Xor
1665  * @since  Method available since Release 3.0.0
1666  */
1667 function logicalXor()
1668 {
1669     return PHPUnit_Framework_Assert::logicalXor();
1670 }
1671
1672 /**
1673  * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
1674  *
1675  * @param  string $string
1676  * @return PHPUnit_Framework_Constraint_StringMatches
1677  * @since  Method available since Release 3.5.0
1678  */
1679 function matches($string)
1680 {
1681     return PHPUnit_Framework_Assert::matches($string);
1682 }
1683
1684 /**
1685  * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
1686  *
1687  * @param  string $pattern
1688  * @return PHPUnit_Framework_Constraint_PCREMatch
1689  * @since  Method available since Release 3.0.0
1690  */
1691 function matchesRegularExpression($pattern)
1692 {
1693     return PHPUnit_Framework_Assert::matchesRegularExpression($pattern);
1694 }
1695
1696 /**
1697  * Returns a matcher that matches when the method it is evaluated for
1698  * is never executed.
1699  *
1700  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1701  * @since  Method available since Release 3.0.0
1702  */
1703 function never()
1704 {
1705     return PHPUnit_Framework_TestCase::never();
1706 }
1707
1708 /**
1709  * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
1710  *
1711  * @param  string $attributeName
1712  * @return PHPUnit_Framework_Constraint_ObjectHasAttribute
1713  * @since  Method available since Release 3.0.0
1714  */
1715 function objectHasAttribute($attributeName)
1716 {
1717     return PHPUnit_Framework_Assert::objectHasAttribute($attributeName);
1718 }
1719
1720 /**
1721  *
1722  *
1723  * @param  mixed $value, ...
1724  * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
1725  * @since  Method available since Release 3.0.0
1726  */
1727 function onConsecutiveCalls()
1728 {
1729     return PHPUnit_Framework_TestCase::onConsecutiveCalls();
1730 }
1731
1732 /**
1733  * Returns a matcher that matches when the method it is evaluated for
1734  * is executed exactly once.
1735  *
1736  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1737  * @since  Method available since Release 3.0.0
1738  */
1739 function once()
1740 {
1741     return PHPUnit_Framework_TestCase::once();
1742 }
1743
1744 /**
1745  *
1746  *
1747  * @param  integer $argumentIndex
1748  * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
1749  * @since  Method available since Release 3.3.0
1750  */
1751 function returnArgument($argumentIndex)
1752 {
1753     return PHPUnit_Framework_TestCase::returnArgument($argumentIndex);
1754 }
1755
1756 /**
1757  *
1758  *
1759  * @param  mixed $callback
1760  * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
1761  * @since  Method available since Release 3.3.0
1762  */
1763 function returnCallback($callback)
1764 {
1765     return PHPUnit_Framework_TestCase::returnCallback($callback);
1766 }
1767
1768 /**
1769  *
1770  *
1771  * @param  mixed $value
1772  * @return PHPUnit_Framework_MockObject_Stub_Return
1773  * @since  Method available since Release 3.0.0
1774  */
1775 function returnValue($value)
1776 {
1777     return PHPUnit_Framework_TestCase::returnValue($value);
1778 }
1779
1780 /**
1781  * Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
1782  *
1783  * @param  string  $string
1784  * @param  boolean $case
1785  * @return PHPUnit_Framework_Constraint_StringContains
1786  * @since  Method available since Release 3.0.0
1787  */
1788 function stringContains($string, $case = TRUE)
1789 {
1790     return PHPUnit_Framework_Assert::stringContains($string, $case);
1791 }
1792
1793 /**
1794  * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
1795  *
1796  * @param  mixed $suffix
1797  * @return PHPUnit_Framework_Constraint_StringEndsWith
1798  * @since  Method available since Release 3.4.0
1799  */
1800 function stringEndsWith($suffix)
1801 {
1802     return PHPUnit_Framework_Assert::stringEndsWith($suffix);
1803 }
1804
1805 /**
1806  * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
1807  *
1808  * @param  mixed $prefix
1809  * @return PHPUnit_Framework_Constraint_StringStartsWith
1810  * @since  Method available since Release 3.4.0
1811  */
1812 function stringStartsWith($prefix)
1813 {
1814     return PHPUnit_Framework_Assert::stringStartsWith($prefix);
1815 }
1816
1817 /**
1818  *
1819  *
1820  * @param  Exception $exception
1821  * @return PHPUnit_Framework_MockObject_Stub_Exception
1822  * @since  Method available since Release 3.1.0
1823  */
1824 function throwException(Exception $exception)
1825 {
1826     return PHPUnit_Framework_TestCase::throwException($exception);
1827 }