]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/PHPUnit/PHPUnit/Framework/Assert/Functions.php
Release 6.2.1
[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  * @deprecated
369  */
370 function assertAttributeNotType($expected, $attributeName, $classOrObject, $message = '')
371 {
372     return PHPUnit_Framework_Assert::assertAttributeNotType($expected, $attributeName, $classOrObject, $message);
373 }
374
375 /**
376  * Asserts that a variable and an attribute of an object have the same type
377  * and value.
378  *
379  * @param  mixed  $expected
380  * @param  string $actualAttributeName
381  * @param  object $actualClassOrObject
382  * @param  string $message
383  */
384 function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
385 {
386     return PHPUnit_Framework_Assert::assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message);
387 }
388
389 /**
390  * Asserts that an attribute is of a given type.
391  *
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
397  * @deprecated
398  */
399 function assertAttributeType($expected, $attributeName, $classOrObject, $message = '')
400 {
401     return PHPUnit_Framework_Assert::assertAttributeType($expected, $attributeName, $classOrObject, $message);
402 }
403
404 /**
405  * Asserts that a class has a specified attribute.
406  *
407  * @param  string $attributeName
408  * @param  string $className
409  * @param  string $message
410  * @since  Method available since Release 3.1.0
411  */
412 function assertClassHasAttribute($attributeName, $className, $message = '')
413 {
414     return PHPUnit_Framework_Assert::assertClassHasAttribute($attributeName, $className, $message);
415 }
416
417 /**
418  * Asserts that a class has a specified static attribute.
419  *
420  * @param  string $attributeName
421  * @param  string $className
422  * @param  string $message
423  * @since  Method available since Release 3.1.0
424  */
425 function assertClassHasStaticAttribute($attributeName, $className, $message = '')
426 {
427     return PHPUnit_Framework_Assert::assertClassHasStaticAttribute($attributeName, $className, $message);
428 }
429
430 /**
431  * Asserts that a class does not have a specified attribute.
432  *
433  * @param  string $attributeName
434  * @param  string $className
435  * @param  string $message
436  * @since  Method available since Release 3.1.0
437  */
438 function assertClassNotHasAttribute($attributeName, $className, $message = '')
439 {
440     return PHPUnit_Framework_Assert::assertClassNotHasAttribute($attributeName, $className, $message);
441 }
442
443 /**
444  * Asserts that a class does not have a specified static attribute.
445  *
446  * @param  string $attributeName
447  * @param  string $className
448  * @param  string $message
449  * @since  Method available since Release 3.1.0
450  */
451 function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
452 {
453     return PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute($attributeName, $className, $message);
454 }
455
456 /**
457  * Asserts that a haystack contains a needle.
458  *
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
464  */
465 function assertContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
466 {
467     return PHPUnit_Framework_Assert::assertContains($needle, $haystack, $message, $ignoreCase);
468 }
469
470 /**
471  * Asserts that a haystack contains only values of a given type.
472  *
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
478  */
479 function assertContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
480 {
481     return PHPUnit_Framework_Assert::assertContainsOnly($type, $haystack, $isNativeType, $message);
482 }
483
484 /**
485  * Asserts that a variable is empty.
486  *
487  * @param  mixed   $actual
488  * @param  string  $message
489  * @throws PHPUnit_Framework_AssertionFailedError
490  */
491 function assertEmpty($actual, $message = '')
492 {
493     return PHPUnit_Framework_Assert::assertEmpty($actual, $message);
494 }
495
496 /**
497  * Asserts that a hierarchy of DOMNodes matches.
498  *
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
505  */
506 function assertEqualXMLStructure(DOMNode $expectedNode, DOMNode $actualNode, $checkAttributes = FALSE, $message = '')
507 {
508     return PHPUnit_Framework_Assert::assertEqualXMLStructure($expectedNode, $actualNode, $checkAttributes, $message);
509 }
510
511 /**
512  * Asserts that two variables are equal.
513  *
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
521  */
522 function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
523 {
524     return PHPUnit_Framework_Assert::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
525 }
526
527 /**
528  * Asserts that a condition is false.
529  *
530  * @param  boolean  $condition
531  * @param  string   $message
532  * @throws PHPUnit_Framework_AssertionFailedError
533  */
534 function assertFalse($condition, $message = '')
535 {
536     return PHPUnit_Framework_Assert::assertFalse($condition, $message);
537 }
538
539 /**
540  * Asserts that the contents of one file is equal to the contents of another
541  * file.
542  *
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
549  */
550 function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
551 {
552     return PHPUnit_Framework_Assert::assertFileEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
553 }
554
555 /**
556  * Asserts that a file exists.
557  *
558  * @param  string $filename
559  * @param  string $message
560  * @since  Method available since Release 3.0.0
561  */
562 function assertFileExists($filename, $message = '')
563 {
564     return PHPUnit_Framework_Assert::assertFileExists($filename, $message);
565 }
566
567 /**
568  * Asserts that the contents of one file is not equal to the contents of
569  * another file.
570  *
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
577  */
578 function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
579 {
580     return PHPUnit_Framework_Assert::assertFileNotEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
581 }
582
583 /**
584  * Asserts that a file does not exist.
585  *
586  * @param  string $filename
587  * @param  string $message
588  * @since  Method available since Release 3.0.0
589  */
590 function assertFileNotExists($filename, $message = '')
591 {
592     return PHPUnit_Framework_Assert::assertFileNotExists($filename, $message);
593 }
594
595 /**
596  * Asserts that a value is greater than another value.
597  *
598  * @param  mixed   $expected
599  * @param  mixed   $actual
600  * @param  string  $message
601  * @since  Method available since Release 3.1.0
602  */
603 function assertGreaterThan($expected, $actual, $message = '')
604 {
605     return PHPUnit_Framework_Assert::assertGreaterThan($expected, $actual, $message);
606 }
607
608 /**
609  * Asserts that a value is greater than or equal to another value.
610  *
611  * @param  mixed   $expected
612  * @param  mixed   $actual
613  * @param  string  $message
614  * @since  Method available since Release 3.1.0
615  */
616 function assertGreaterThanOrEqual($expected, $actual, $message = '')
617 {
618     return PHPUnit_Framework_Assert::assertGreaterThanOrEqual($expected, $actual, $message);
619 }
620
621 /**
622  * Asserts that a variable is of a given type.
623  *
624  * @param string $expected
625  * @param mixed  $actual
626  * @param string $message
627  * @since Method available since Release 3.5.0
628  */
629 function assertInstanceOf($expected, $actual, $message = '')
630 {
631     return PHPUnit_Framework_Assert::assertInstanceOf($expected, $actual, $message);
632 }
633
634 /**
635  * Asserts that a variable is of a given type.
636  *
637  * @param string $expected
638  * @param mixed  $actual
639  * @param string $message
640  * @since Method available since Release 3.5.0
641  */
642 function assertInternalType($expected, $actual, $message = '')
643 {
644     return PHPUnit_Framework_Assert::assertInternalType($expected, $actual, $message);
645 }
646
647 /**
648  * Asserts that a value is smaller than another value.
649  *
650  * @param  mixed   $expected
651  * @param  mixed   $actual
652  * @param  string  $message
653  * @since  Method available since Release 3.1.0
654  */
655 function assertLessThan($expected, $actual, $message = '')
656 {
657     return PHPUnit_Framework_Assert::assertLessThan($expected, $actual, $message);
658 }
659
660 /**
661  * Asserts that a value is smaller than or equal to another value.
662  *
663  * @param  mixed   $expected
664  * @param  mixed   $actual
665  * @param  string  $message
666  * @since  Method available since Release 3.1.0
667  */
668 function assertLessThanOrEqual($expected, $actual, $message = '')
669 {
670     return PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $message);
671 }
672
673 /**
674  * Asserts that a haystack does not contain a needle.
675  *
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
681  */
682 function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
683 {
684     return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase);
685 }
686
687 /**
688  * Asserts that a haystack does not contain only values of a given type.
689  *
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
695  */
696 function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
697 {
698     return PHPUnit_Framework_Assert::assertNotContainsOnly($type, $haystack, $isNativeType, $message);
699 }
700
701 /**
702  * Asserts that a variable is not empty.
703  *
704  * @param  mixed   $actual
705  * @param  string  $message
706  * @throws PHPUnit_Framework_AssertionFailedError
707  */
708 function assertNotEmpty($actual, $message = '')
709 {
710     return PHPUnit_Framework_Assert::assertNotEmpty($actual, $message);
711 }
712
713 /**
714  * Asserts that two variables are not equal.
715  *
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
724  */
725 function assertNotEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
726 {
727     return PHPUnit_Framework_Assert::assertNotEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase);
728 }
729
730 /**
731  * Asserts that a variable is not of a given type.
732  *
733  * @param string $expected
734  * @param mixed  $actual
735  * @param string $message
736  * @since Method available since Release 3.5.0
737  */
738 function assertNotInstanceOf($expected, $actual, $message = '')
739 {
740     return PHPUnit_Framework_Assert::assertNotInstanceOf($expected, $actual, $message);
741 }
742
743 /**
744  * Asserts that a variable is not of a given type.
745  *
746  * @param string $expected
747  * @param mixed  $actual
748  * @param string $message
749  * @since Method available since Release 3.5.0
750  */
751 function assertNotInternalType($expected, $actual, $message = '')
752 {
753     return PHPUnit_Framework_Assert::assertNotInternalType($expected, $actual, $message);
754 }
755
756 /**
757  * Asserts that a variable is not NULL.
758  *
759  * @param  mixed  $actual
760  * @param  string $message
761  */
762 function assertNotNull($actual, $message = '')
763 {
764     return PHPUnit_Framework_Assert::assertNotNull($actual, $message);
765 }
766
767 /**
768  * Asserts that a string does not match a given regular expression.
769  *
770  * @param  string $pattern
771  * @param  string $string
772  * @param  string $message
773  * @since  Method available since Release 2.1.0
774  */
775 function assertNotRegExp($pattern, $string, $message = '')
776 {
777     return PHPUnit_Framework_Assert::assertNotRegExp($pattern, $string, $message);
778 }
779
780 /**
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
783  * the same object.
784  *
785  * @param  mixed  $expected
786  * @param  mixed  $actual
787  * @param  string $message
788  */
789 function assertNotSame($expected, $actual, $message = '')
790 {
791     return PHPUnit_Framework_Assert::assertNotSame($expected, $actual, $message);
792 }
793
794 /**
795  * This assertion is the exact opposite of assertTag().
796  *
797  * Rather than asserting that $matcher results in a match, it asserts that
798  * $matcher does not match.
799  *
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>
807  */
808 function assertNotTag($matcher, $actual, $message = '', $isHtml = TRUE)
809 {
810     return PHPUnit_Framework_Assert::assertNotTag($matcher, $actual, $message, $isHtml);
811 }
812
813 /**
814  * Asserts that a variable is not of a given type.
815  *
816  * @param  string $expected
817  * @param  mixed  $actual
818  * @param  string $message
819  * @since  Method available since Release 2.2.0
820  * @deprecated
821  */
822 function assertNotType($expected, $actual, $message = '')
823 {
824     return PHPUnit_Framework_Assert::assertNotType($expected, $actual, $message);
825 }
826
827 /**
828  * Asserts that a variable is NULL.
829  *
830  * @param  mixed  $actual
831  * @param  string $message
832  */
833 function assertNull($actual, $message = '')
834 {
835     return PHPUnit_Framework_Assert::assertNull($actual, $message);
836 }
837
838 /**
839  * Asserts that an object has a specified attribute.
840  *
841  * @param  string $attributeName
842  * @param  object $object
843  * @param  string $message
844  * @since  Method available since Release 3.0.0
845  */
846 function assertObjectHasAttribute($attributeName, $object, $message = '')
847 {
848     return PHPUnit_Framework_Assert::assertObjectHasAttribute($attributeName, $object, $message);
849 }
850
851 /**
852  * Asserts that an object does not have a specified attribute.
853  *
854  * @param  string $attributeName
855  * @param  object $object
856  * @param  string $message
857  * @since  Method available since Release 3.0.0
858  */
859 function assertObjectNotHasAttribute($attributeName, $object, $message = '')
860 {
861     return PHPUnit_Framework_Assert::assertObjectNotHasAttribute($attributeName, $object, $message);
862 }
863
864 /**
865  * Asserts that a string matches a given regular expression.
866  *
867  * @param  string $pattern
868  * @param  string $string
869  * @param  string $message
870  */
871 function assertRegExp($pattern, $string, $message = '')
872 {
873     return PHPUnit_Framework_Assert::assertRegExp($pattern, $string, $message);
874 }
875
876 /**
877  * Asserts that two variables have the same type and value.
878  * Used on objects, it asserts that two variables reference
879  * the same object.
880  *
881  * @param  mixed  $expected
882  * @param  mixed  $actual
883  * @param  string $message
884  */
885 function assertSame($expected, $actual, $message = '')
886 {
887     return PHPUnit_Framework_Assert::assertSame($expected, $actual, $message);
888 }
889
890 /**
891  * Assert the presence, absence, or count of elements in a document matching
892  * the CSS $selector, regardless of the contents of those elements.
893  *
894  * The first argument, $selector, is the CSS selector used to match
895  * the elements in the $actual document.
896  *
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.
901  *
902  * assertSelectCount("#binder", true, $xml);  // any?
903  * assertSelectCount(".binder", 3, $xml); // exactly 3?
904  *
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>
913  */
914 function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = TRUE)
915 {
916     return PHPUnit_Framework_Assert::assertSelectCount($selector, $count, $actual, $message, $isHtml);
917 }
918
919 /**
920  * assertSelectEquals("#binder .name", "Chuck", true,  $xml);  // any?
921  * assertSelectEquals("#binder .name", "Chuck", false, $xml);  // none?
922  *
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>
932  */
933 function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = TRUE)
934 {
935     return PHPUnit_Framework_Assert::assertSelectEquals($selector, $content, $count, $actual, $message, $isHtml);
936 }
937
938 /**
939  * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
940  * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
941  *
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>
951  */
952 function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = TRUE)
953 {
954     return PHPUnit_Framework_Assert::assertSelectRegExp($selector, $pattern, $count, $actual, $message, $isHtml);
955 }
956
957 /**
958  * Asserts that a string ends not with a given prefix.
959  *
960  * @param  string $suffix
961  * @param  string $string
962  * @param  string $message
963  * @since  Method available since Release 3.4.0
964  */
965 function assertStringEndsNotWith($suffix, $string, $message = '')
966 {
967     return PHPUnit_Framework_Assert::assertStringEndsNotWith($suffix, $string, $message);
968 }
969
970 /**
971  * Asserts that a string ends with a given prefix.
972  *
973  * @param  string $suffix
974  * @param  string $string
975  * @param  string $message
976  * @since  Method available since Release 3.4.0
977  */
978 function assertStringEndsWith($suffix, $string, $message = '')
979 {
980     return PHPUnit_Framework_Assert::assertStringEndsWith($suffix, $string, $message);
981 }
982
983 /**
984  * Asserts that the contents of a string is equal
985  * to the contents of a file.
986  *
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
993  */
994 function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
995 {
996     return PHPUnit_Framework_Assert::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
997 }
998
999 /**
1000  * Asserts that a string matches a given format string.
1001  *
1002  * @param  string $format
1003  * @param  string $string
1004  * @param  string $message
1005  * @since  Method available since Release 3.5.0
1006  */
1007 function assertStringMatchesFormat($format, $string, $message = '')
1008 {
1009     return PHPUnit_Framework_Assert::assertStringMatchesFormat($format, $string, $message);
1010 }
1011
1012 /**
1013  * Asserts that a string matches a given format file.
1014  *
1015  * @param  string $formatFile
1016  * @param  string $string
1017  * @param  string $message
1018  * @since  Method available since Release 3.5.0
1019  */
1020 function assertStringMatchesFormatFile($formatFile, $string, $message = '')
1021 {
1022     return PHPUnit_Framework_Assert::assertStringMatchesFormatFile($formatFile, $string, $message);
1023 }
1024
1025 /**
1026  * Asserts that the contents of a string is not equal
1027  * to the contents of a file.
1028  *
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
1035  */
1036 function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
1037 {
1038     return PHPUnit_Framework_Assert::assertStringNotEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
1039 }
1040
1041 /**
1042  * Asserts that a string does not match a given format string.
1043  *
1044  * @param  string $format
1045  * @param  string $string
1046  * @param  string $message
1047  * @since  Method available since Release 3.5.0
1048  */
1049 function assertStringNotMatchesFormat($format, $string, $message = '')
1050 {
1051     return PHPUnit_Framework_Assert::assertStringNotMatchesFormat($format, $string, $message);
1052 }
1053
1054 /**
1055  * Asserts that a string does not match a given format string.
1056  *
1057  * @param  string $formatFile
1058  * @param  string $string
1059  * @param  string $message
1060  * @since  Method available since Release 3.5.0
1061  */
1062 function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
1063 {
1064     return PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile($formatFile, $string, $message);
1065 }
1066
1067 /**
1068  * Asserts that a string starts not with a given prefix.
1069  *
1070  * @param  string $prefix
1071  * @param  string $string
1072  * @param  string $message
1073  * @since  Method available since Release 3.4.0
1074  */
1075 function assertStringStartsNotWith($prefix, $string, $message = '')
1076 {
1077     return PHPUnit_Framework_Assert::assertStringStartsNotWith($prefix, $string, $message);
1078 }
1079
1080 /**
1081  * Asserts that a string starts with a given prefix.
1082  *
1083  * @param  string $prefix
1084  * @param  string $string
1085  * @param  string $message
1086  * @since  Method available since Release 3.4.0
1087  */
1088 function assertStringStartsWith($prefix, $string, $message = '')
1089 {
1090     return PHPUnit_Framework_Assert::assertStringStartsWith($prefix, $string, $message);
1091 }
1092
1093 /**
1094  * Evaluate an HTML or XML string and assert its structure and/or contents.
1095  *
1096  * The first argument ($matcher) is an associative array that specifies the
1097  * match criteria for the assertion:
1098  *
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.
1114  * Accepts the keys:
1115  *- `count`: a number which must equal the number of children
1116  *   that match
1117  *- `less_than`: the number of matching children must be greater
1118  *   than this number
1119  *- `greater_than` : the number of matching children must be less than
1120  *   this number
1121  *- `only` : another hash consisting of the keys to use to match
1122  *   on the children, and only matching children will be
1123  *   counted
1124  *
1125  * <code>
1126  * // Matcher that asserts that there is an element with an id="my_id".
1127  * $matcher = array('id' => 'my_id');
1128  *
1129  * // Matcher that asserts that there is a "span" tag.
1130  * $matcher = array('tag' => 'span');
1131  *
1132  * // Matcher that asserts that there is a "span" tag with the content
1133  * // "Hello World".
1134  * $matcher = array('tag' => 'span', 'content' => 'Hello World');
1135  *
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)/');
1139  *
1140  * // Matcher that asserts that there is a "span" with an "list" class
1141  * // attribute.
1142  * $matcher = array(
1143  *   'tag'=> 'span',
1144  *   'attributes' => array('class' => 'list')
1145  * );
1146  *
1147  * // Matcher that asserts that there is a "span" inside of a "div".
1148  * $matcher = array(
1149  *   'tag'=> 'span',
1150  *   'parent' => array('tag' => 'div')
1151  * );
1152  *
1153  * // Matcher that asserts that there is a "span" somewhere inside a
1154  * // "table".
1155  * $matcher = array(
1156  *   'tag'  => 'span',
1157  *   'ancestor' => array('tag' => 'table')
1158  * );
1159  *
1160  * // Matcher that asserts that there is a "span" with at least one "em"
1161  * // child.
1162  * $matcher = array(
1163  *   'tag'   => 'span',
1164  *   'child' => array('tag' => 'em')
1165  * );
1166  *
1167  * // Matcher that asserts that there is a "span" containing a (possibly
1168  * // nested) "strong" tag.
1169  * $matcher = array(
1170  *   'tag'=> 'span',
1171  *   'descendant' => array('tag' => 'strong')
1172  * );
1173  *
1174  * // Matcher that asserts that there is a "span" containing 5-10 "em" tags
1175  * // as immediate children.
1176  * $matcher = array(
1177  *   'tag'  => 'span',
1178  *   'children' => array(
1179  * 'less_than'=> 11,
1180  * 'greater_than' => 4,
1181  * 'only' => array('tag' => 'em')
1182  *   )
1183  * );
1184  *
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".
1188  * $matcher = array(
1189  *   'tag'=> 'div',
1190  *   'ancestor'   => array('tag' => 'ul'),
1191  *   'parent' => array(
1192  * 'tag'=> 'li',
1193  * 'attributes' => array('class' => 'enum')
1194  *   ),
1195  *   'descendant' => array(
1196  * 'tag'   => 'span',
1197  * 'child' => array(
1198  *   'id'  => 'my_test',
1199  *   'content' => 'Hello World'
1200  * )
1201  *   )
1202  * );
1203  *
1204  * // Use assertTag() to apply a $matcher to a piece of $html.
1205  * $this->assertTag($matcher, $html);
1206  *
1207  * // Use assertTag() to apply a $matcher to a piece of $xml.
1208  * $this->assertTag($matcher, $xml, '', FALSE);
1209  * </code>
1210  *
1211  * The second argument ($actual) is a string containing either HTML or
1212  * XML text to be tested.
1213  *
1214  * The third argument ($message) is an optional message that will be
1215  * used if the assertion fails.
1216  *
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.
1221  *
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>
1229  */
1230 function assertTag($matcher, $actual, $message = '', $isHtml = TRUE)
1231 {
1232     return PHPUnit_Framework_Assert::assertTag($matcher, $actual, $message, $isHtml);
1233 }
1234
1235 /**
1236  * Evaluates a PHPUnit_Framework_Constraint matcher object.
1237  *
1238  * @param  mixed$value
1239  * @param  PHPUnit_Framework_Constraint $constraint
1240  * @param  string   $message
1241  * @since  Method available since Release 3.0.0
1242  */
1243 function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
1244 {
1245     return PHPUnit_Framework_Assert::assertThat($value, $constraint, $message);
1246 }
1247
1248 /**
1249  * Asserts that a condition is true.
1250  *
1251  * @param  boolean $condition
1252  * @param  string  $message
1253  * @throws PHPUnit_Framework_AssertionFailedError
1254  */
1255 function assertTrue($condition, $message = '')
1256 {
1257     return PHPUnit_Framework_Assert::assertTrue($condition, $message);
1258 }
1259
1260 /**
1261  * Asserts that a variable is of a given type.
1262  *
1263  * @param  string $expected
1264  * @param  mixed  $actual
1265  * @param  string $message
1266  * @deprecated
1267  */
1268 function assertType($expected, $actual, $message = '')
1269 {
1270     return PHPUnit_Framework_Assert::assertType($expected, $actual, $message);
1271 }
1272
1273 /**
1274  * Asserts that two XML files are equal.
1275  *
1276  * @param  string $expectedFile
1277  * @param  string $actualFile
1278  * @param  string $message
1279  * @since  Method available since Release 3.1.0
1280  */
1281 function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
1282 {
1283     return PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message);
1284 }
1285
1286 /**
1287  * Asserts that two XML files are not equal.
1288  *
1289  * @param  string $expectedFile
1290  * @param  string $actualFile
1291  * @param  string $message
1292  * @since  Method available since Release 3.1.0
1293  */
1294 function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
1295 {
1296     return PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message);
1297 }
1298
1299 /**
1300  * Asserts that two XML documents are equal.
1301  *
1302  * @param  string $expectedFile
1303  * @param  string $actualXml
1304  * @param  string $message
1305  * @since  Method available since Release 3.3.0
1306  */
1307 function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
1308 {
1309     return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message);
1310 }
1311
1312 /**
1313  * Asserts that two XML documents are equal.
1314  *
1315  * @param  string $expectedXml
1316  * @param  string $actualXml
1317  * @param  string $message
1318  * @since  Method available since Release 3.1.0
1319  */
1320 function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
1321 {
1322     return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message);
1323 }
1324
1325 /**
1326  * Asserts that two XML documents are not equal.
1327  *
1328  * @param  string $expectedFile
1329  * @param  string $actualXml
1330  * @param  string $message
1331  * @since  Method available since Release 3.3.0
1332  */
1333 function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
1334 {
1335     return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message);
1336 }
1337
1338 /**
1339  * Asserts that two XML documents are not equal.
1340  *
1341  * @param  string $expectedXml
1342  * @param  string $actualXml
1343  * @param  string $message
1344  * @since  Method available since Release 3.1.0
1345  */
1346 function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
1347 {
1348     return PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message);
1349 }
1350
1351 /**
1352  * Returns a matcher that matches when the method it is evaluated for
1353  * is invoked at the given $index.
1354  *
1355  * @param  integer $index
1356  * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
1357  * @since  Method available since Release 3.0.0
1358  */
1359 function at($index)
1360 {
1361     return PHPUnit_Framework_TestCase::at($index);
1362 }
1363
1364 /**
1365  * Returns a matcher that matches when the method it is evaluated for
1366  * is executed at least once.
1367  *
1368  * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
1369  * @since  Method available since Release 3.0.0
1370  */
1371 function atLeastOnce()
1372 {
1373     return PHPUnit_Framework_TestCase::atLeastOnce();
1374 }
1375
1376 /**
1377  * Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
1378  *
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
1383  */
1384 function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
1385 {
1386     return PHPUnit_Framework_Assert::attribute($constraint, $attributeName);
1387 }
1388
1389 /**
1390  * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
1391  * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
1392  * object.
1393  *
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
1402  */
1403 function attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1404 {
1405     return PHPUnit_Framework_Assert::attributeEqualTo($attributeName, $value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1406 }
1407
1408 /**
1409  * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
1410  *
1411  * @param  string $attributeName
1412  * @return PHPUnit_Framework_Constraint_ClassHasAttribute
1413  * @since  Method available since Release 3.1.0
1414  */
1415 function classHasAttribute($attributeName)
1416 {
1417     return PHPUnit_Framework_Assert::classHasAttribute($attributeName);
1418 }
1419
1420 /**
1421  * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
1422  * object.
1423  *
1424  * @param  string $attributeName
1425  * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
1426  * @since  Method available since Release 3.1.0
1427  */
1428 function classHasStaticAttribute($attributeName)
1429 {
1430     return PHPUnit_Framework_Assert::classHasStaticAttribute($attributeName);
1431 }
1432
1433 /**
1434  * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
1435  * object.
1436  *
1437  * @param  mixed $value
1438  * @return PHPUnit_Framework_Constraint_TraversableContains
1439  * @since  Method available since Release 3.0.0
1440  */
1441 function contains($value)
1442 {
1443     return PHPUnit_Framework_Assert::contains($value);
1444 }
1445
1446 /**
1447  * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1448  * object.
1449  *
1450  * @param  string $type
1451  * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1452  * @since  Method available since Release 3.1.4
1453  */
1454 function containsOnly($type)
1455 {
1456     return PHPUnit_Framework_Assert::containsOnly($type);
1457 }
1458
1459 /**
1460  * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
1461  *
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
1469  */
1470 function equalTo($value, $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)
1471 {
1472     return PHPUnit_Framework_Assert::equalTo($value, $delta, $maxDepth, $canonicalize, $ignoreCase);
1473 }
1474
1475 /**
1476  * Returns a matcher that matches when the method it is evaluated for
1477  * is executed exactly $count times.
1478  *
1479  * @param  integer $count
1480  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1481  * @since  Method available since Release 3.0.0
1482  */
1483 function exactly($count)
1484 {
1485     return PHPUnit_Framework_TestCase::exactly($count);
1486 }
1487
1488 /**
1489  * Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
1490  *
1491  * @return PHPUnit_Framework_Constraint_FileExists
1492  * @since  Method available since Release 3.0.0
1493  */
1494 function fileExists()
1495 {
1496     return PHPUnit_Framework_Assert::fileExists();
1497 }
1498
1499 /**
1500  * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
1501  *
1502  * @param  mixed $value
1503  * @return PHPUnit_Framework_Constraint_GreaterThan
1504  * @since  Method available since Release 3.0.0
1505  */
1506 function greaterThan($value)
1507 {
1508     return PHPUnit_Framework_Assert::greaterThan($value);
1509 }
1510
1511 /**
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.
1515  *
1516  * @param  mixed $value
1517  * @return PHPUnit_Framework_Constraint_Or
1518  * @since  Method available since Release 3.1.0
1519  */
1520 function greaterThanOrEqual($value)
1521 {
1522     return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
1523 }
1524
1525 /**
1526  * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
1527  *
1528  * @param  mixed $value
1529  * @return PHPUnit_Framework_Constraint_IsIdentical
1530  * @since  Method available since Release 3.0.0
1531  */
1532 function identicalTo($value)
1533 {
1534     return PHPUnit_Framework_Assert::identicalTo($value);
1535 }
1536
1537 /**
1538  * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
1539  *
1540  * @return PHPUnit_Framework_Constraint_IsEmpty
1541  * @since  Method available since Release 3.5.0
1542  */
1543 function isEmpty()
1544 {
1545     return PHPUnit_Framework_Assert::isEmpty();
1546 }
1547
1548 /**
1549  * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
1550  *
1551  * @return PHPUnit_Framework_Constraint_IsFalse
1552  * @since  Method available since Release 3.3.0
1553  */
1554 function isFalse()
1555 {
1556     return PHPUnit_Framework_Assert::isFalse();
1557 }
1558
1559 /**
1560  * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
1561  *
1562  * @param  string $className
1563  * @return PHPUnit_Framework_Constraint_IsInstanceOf
1564  * @since  Method available since Release 3.0.0
1565  */
1566 function isInstanceOf($className)
1567 {
1568     return PHPUnit_Framework_Assert::isInstanceOf($className);
1569 }
1570
1571 /**
1572  * Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
1573  *
1574  * @return PHPUnit_Framework_Constraint_IsNull
1575  * @since  Method available since Release 3.3.0
1576  */
1577 function isNull()
1578 {
1579     return PHPUnit_Framework_Assert::isNull();
1580 }
1581
1582 /**
1583  * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
1584  *
1585  * @return PHPUnit_Framework_Constraint_IsTrue
1586  * @since  Method available since Release 3.3.0
1587  */
1588 function isTrue()
1589 {
1590     return PHPUnit_Framework_Assert::isTrue();
1591 }
1592
1593 /**
1594  * Returns a PHPUnit_Framework_Constraint_IsType matcher object.
1595  *
1596  * @param  string $type
1597  * @return PHPUnit_Framework_Constraint_IsType
1598  * @since  Method available since Release 3.0.0
1599  */
1600 function isType($type)
1601 {
1602     return PHPUnit_Framework_Assert::isType($type);
1603 }
1604
1605 /**
1606  * Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
1607  *
1608  * @param  mixed $value
1609  * @return PHPUnit_Framework_Constraint_LessThan
1610  * @since  Method available since Release 3.0.0
1611  */
1612 function lessThan($value)
1613 {
1614     return PHPUnit_Framework_Assert::lessThan($value);
1615 }
1616
1617 /**
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.
1621  *
1622  * @param  mixed $value
1623  * @return PHPUnit_Framework_Constraint_Or
1624  * @since  Method available since Release 3.1.0
1625  */
1626 function lessThanOrEqual($value)
1627 {
1628     return PHPUnit_Framework_Assert::lessThanOrEqual($value);
1629 }
1630
1631 /**
1632  * Returns a PHPUnit_Framework_Constraint_And matcher object.
1633  *
1634  * @return PHPUnit_Framework_Constraint_And
1635  * @since  Method available since Release 3.0.0
1636  */
1637 function logicalAnd()
1638 {
1639     return PHPUnit_Framework_Assert::logicalAnd();
1640 }
1641
1642 /**
1643  * Returns a PHPUnit_Framework_Constraint_Not matcher object.
1644  *
1645  * @param  PHPUnit_Framework_Constraint $constraint
1646  * @return PHPUnit_Framework_Constraint_Not
1647  * @since  Method available since Release 3.0.0
1648  */
1649 function logicalNot(PHPUnit_Framework_Constraint $constraint)
1650 {
1651     return PHPUnit_Framework_Assert::logicalNot($constraint);
1652 }
1653
1654 /**
1655  * Returns a PHPUnit_Framework_Constraint_Or matcher object.
1656  *
1657  * @return PHPUnit_Framework_Constraint_Or
1658  * @since  Method available since Release 3.0.0
1659  */
1660 function logicalOr()
1661 {
1662     return PHPUnit_Framework_Assert::logicalOr();
1663 }
1664
1665 /**
1666  * Returns a PHPUnit_Framework_Constraint_Xor matcher object.
1667  *
1668  * @return PHPUnit_Framework_Constraint_Xor
1669  * @since  Method available since Release 3.0.0
1670  */
1671 function logicalXor()
1672 {
1673     return PHPUnit_Framework_Assert::logicalXor();
1674 }
1675
1676 /**
1677  * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
1678  *
1679  * @param  string $string
1680  * @return PHPUnit_Framework_Constraint_StringMatches
1681  * @since  Method available since Release 3.5.0
1682  */
1683 function matches($string)
1684 {
1685     return PHPUnit_Framework_Assert::matches($string);
1686 }
1687
1688 /**
1689  * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
1690  *
1691  * @param  string $pattern
1692  * @return PHPUnit_Framework_Constraint_PCREMatch
1693  * @since  Method available since Release 3.0.0
1694  */
1695 function matchesRegularExpression($pattern)
1696 {
1697     return PHPUnit_Framework_Assert::matchesRegularExpression($pattern);
1698 }
1699
1700 /**
1701  * Returns a matcher that matches when the method it is evaluated for
1702  * is never executed.
1703  *
1704  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1705  * @since  Method available since Release 3.0.0
1706  */
1707 function never()
1708 {
1709     return PHPUnit_Framework_TestCase::never();
1710 }
1711
1712 /**
1713  * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
1714  *
1715  * @param  string $attributeName
1716  * @return PHPUnit_Framework_Constraint_ObjectHasAttribute
1717  * @since  Method available since Release 3.0.0
1718  */
1719 function objectHasAttribute($attributeName)
1720 {
1721     return PHPUnit_Framework_Assert::objectHasAttribute($attributeName);
1722 }
1723
1724 /**
1725  *
1726  *
1727  * @param  mixed $value, ...
1728  * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
1729  * @since  Method available since Release 3.0.0
1730  */
1731 function onConsecutiveCalls()
1732 {
1733     return PHPUnit_Framework_TestCase::onConsecutiveCalls();
1734 }
1735
1736 /**
1737  * Returns a matcher that matches when the method it is evaluated for
1738  * is executed exactly once.
1739  *
1740  * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1741  * @since  Method available since Release 3.0.0
1742  */
1743 function once()
1744 {
1745     return PHPUnit_Framework_TestCase::once();
1746 }
1747
1748 /**
1749  *
1750  *
1751  * @param  integer $argumentIndex
1752  * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
1753  * @since  Method available since Release 3.3.0
1754  */
1755 function returnArgument($argumentIndex)
1756 {
1757     return PHPUnit_Framework_TestCase::returnArgument($argumentIndex);
1758 }
1759
1760 /**
1761  *
1762  *
1763  * @param  mixed $callback
1764  * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
1765  * @since  Method available since Release 3.3.0
1766  */
1767 function returnCallback($callback)
1768 {
1769     return PHPUnit_Framework_TestCase::returnCallback($callback);
1770 }
1771
1772 /**
1773  *
1774  *
1775  * @param  mixed $value
1776  * @return PHPUnit_Framework_MockObject_Stub_Return
1777  * @since  Method available since Release 3.0.0
1778  */
1779 function returnValue($value)
1780 {
1781     return PHPUnit_Framework_TestCase::returnValue($value);
1782 }
1783
1784 /**
1785  * Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
1786  *
1787  * @param  string  $string
1788  * @param  boolean $case
1789  * @return PHPUnit_Framework_Constraint_StringContains
1790  * @since  Method available since Release 3.0.0
1791  */
1792 function stringContains($string, $case = TRUE)
1793 {
1794     return PHPUnit_Framework_Assert::stringContains($string, $case);
1795 }
1796
1797 /**
1798  * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
1799  *
1800  * @param  mixed $suffix
1801  * @return PHPUnit_Framework_Constraint_StringEndsWith
1802  * @since  Method available since Release 3.4.0
1803  */
1804 function stringEndsWith($suffix)
1805 {
1806     return PHPUnit_Framework_Assert::stringEndsWith($suffix);
1807 }
1808
1809 /**
1810  * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
1811  *
1812  * @param  mixed $prefix
1813  * @return PHPUnit_Framework_Constraint_StringStartsWith
1814  * @since  Method available since Release 3.4.0
1815  */
1816 function stringStartsWith($prefix)
1817 {
1818     return PHPUnit_Framework_Assert::stringStartsWith($prefix);
1819 }
1820
1821 /**
1822  *
1823  *
1824  * @param  Exception $exception
1825  * @return PHPUnit_Framework_MockObject_Stub_Exception
1826  * @since  Method available since Release 3.1.0
1827  */
1828 function throwException(Exception $exception)
1829 {
1830     return PHPUnit_Framework_TestCase::throwException($exception);
1831 }