3
* This file is part of PHPUnit.
5
* (c) Sebastian Bergmann <sebastian@phpunit.de>
7
* For the full copyright and license information, please view the LICENSE
8
* file that was distributed with this source code.
12
* Returns a matcher that matches when the method it is evaluated for
13
* is executed zero or more times.
15
* @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
16
* @since Method available since Release 3.0.0
20
return call_user_func_array(
21
'PHPUnit_Framework_TestCase::any',
27
* Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
29
* @return PHPUnit_Framework_Constraint_IsAnything
30
* @since Method available since Release 3.0.0
34
return call_user_func_array(
35
'PHPUnit_Framework_Assert::anything',
41
* Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
44
* @return PHPUnit_Framework_Constraint_ArrayHasKey
45
* @since Method available since Release 3.0.0
47
function arrayHasKey($key)
49
return call_user_func_array(
50
'PHPUnit_Framework_Assert::arrayHasKey',
56
* Asserts that an array has a specified key.
59
* @param array|ArrayAccess $array
60
* @param string $message
61
* @since Method available since Release 3.0.0
63
function assertArrayHasKey($key, $array, $message = '')
65
return call_user_func_array(
66
'PHPUnit_Framework_Assert::assertArrayHasKey',
72
* Asserts that an array has a specified subset.
74
* @param array|ArrayAccess $subset
75
* @param array|ArrayAccess $array
76
* @param boolean $strict Check for object identity
77
* @param string $message
78
* @since Method available since Release 4.4.0
80
function assertArraySubset($subset, $array, $strict = false, $message = '')
82
return call_user_func_array(
83
'PHPUnit_Framework_Assert::assertArraySubset',
89
* Asserts that an array does not have a specified key.
92
* @param array|ArrayAccess $array
93
* @param string $message
94
* @since Method available since Release 3.0.0
96
function assertArrayNotHasKey($key, $array, $message = '')
98
return call_user_func_array(
99
'PHPUnit_Framework_Assert::assertArrayNotHasKey',
105
* Asserts that a haystack that is stored in a static attribute of a class
106
* or an attribute of an object contains a needle.
108
* @param mixed $needle
109
* @param string $haystackAttributeName
110
* @param mixed $haystackClassOrObject
111
* @param string $message
112
* @param boolean $ignoreCase
113
* @param boolean $checkForObjectIdentity
114
* @param boolean $checkForNonObjectIdentity
115
* @since Method available since Release 3.0.0
117
function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
119
return call_user_func_array(
120
'PHPUnit_Framework_Assert::assertAttributeContains',
126
* Asserts that a haystack that is stored in a static attribute of a class
127
* or an attribute of an object contains only values of a given type.
129
* @param string $type
130
* @param string $haystackAttributeName
131
* @param mixed $haystackClassOrObject
132
* @param boolean $isNativeType
133
* @param string $message
134
* @since Method available since Release 3.1.4
136
function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
138
return call_user_func_array(
139
'PHPUnit_Framework_Assert::assertAttributeContainsOnly',
145
* Asserts the number of elements of an array, Countable or Traversable
146
* that is stored in an attribute.
148
* @param integer $expectedCount
149
* @param string $haystackAttributeName
150
* @param mixed $haystackClassOrObject
151
* @param string $message
152
* @since Method available since Release 3.6.0
154
function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
156
return call_user_func_array(
157
'PHPUnit_Framework_Assert::assertAttributeCount',
163
* Asserts that a static attribute of a class or an attribute of an object
166
* @param string $haystackAttributeName
167
* @param mixed $haystackClassOrObject
168
* @param string $message
169
* @since Method available since Release 3.5.0
171
function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
173
return call_user_func_array(
174
'PHPUnit_Framework_Assert::assertAttributeEmpty',
180
* Asserts that a variable is equal to an attribute of an object.
182
* @param mixed $expected
183
* @param string $actualAttributeName
184
* @param string $actualClassOrObject
185
* @param string $message
186
* @param float $delta
187
* @param integer $maxDepth
188
* @param boolean $canonicalize
189
* @param boolean $ignoreCase
191
function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
193
return call_user_func_array(
194
'PHPUnit_Framework_Assert::assertAttributeEquals',
200
* Asserts that an attribute is greater than another value.
202
* @param mixed $expected
203
* @param string $actualAttributeName
204
* @param string $actualClassOrObject
205
* @param string $message
206
* @since Method available since Release 3.1.0
208
function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
210
return call_user_func_array(
211
'PHPUnit_Framework_Assert::assertAttributeGreaterThan',
217
* Asserts that an attribute is greater than or equal to another value.
219
* @param mixed $expected
220
* @param string $actualAttributeName
221
* @param string $actualClassOrObject
222
* @param string $message
223
* @since Method available since Release 3.1.0
225
function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
227
return call_user_func_array(
228
'PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual',
234
* Asserts that an attribute is of a given type.
236
* @param string $expected
237
* @param string $attributeName
238
* @param mixed $classOrObject
239
* @param string $message
240
* @since Method available since Release 3.5.0
242
function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')
244
return call_user_func_array(
245
'PHPUnit_Framework_Assert::assertAttributeInstanceOf',
251
* Asserts that an attribute is of a given type.
253
* @param string $expected
254
* @param string $attributeName
255
* @param mixed $classOrObject
256
* @param string $message
257
* @since Method available since Release 3.5.0
259
function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '')
261
return call_user_func_array(
262
'PHPUnit_Framework_Assert::assertAttributeInternalType',
268
* Asserts that an attribute is smaller than another value.
270
* @param mixed $expected
271
* @param string $actualAttributeName
272
* @param string $actualClassOrObject
273
* @param string $message
274
* @since Method available since Release 3.1.0
276
function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
278
return call_user_func_array(
279
'PHPUnit_Framework_Assert::assertAttributeLessThan',
285
* Asserts that an attribute is smaller than or equal to another value.
287
* @param mixed $expected
288
* @param string $actualAttributeName
289
* @param string $actualClassOrObject
290
* @param string $message
291
* @since Method available since Release 3.1.0
293
function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
295
return call_user_func_array(
296
'PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual',
302
* Asserts that a haystack that is stored in a static attribute of a class
303
* or an attribute of an object does not contain a needle.
305
* @param mixed $needle
306
* @param string $haystackAttributeName
307
* @param mixed $haystackClassOrObject
308
* @param string $message
309
* @param boolean $ignoreCase
310
* @param boolean $checkForObjectIdentity
311
* @param boolean $checkForNonObjectIdentity
312
* @since Method available since Release 3.0.0
314
function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
316
return call_user_func_array(
317
'PHPUnit_Framework_Assert::assertAttributeNotContains',
323
* Asserts that a haystack that is stored in a static attribute of a class
324
* or an attribute of an object does not contain only values of a given
327
* @param string $type
328
* @param string $haystackAttributeName
329
* @param mixed $haystackClassOrObject
330
* @param boolean $isNativeType
331
* @param string $message
332
* @since Method available since Release 3.1.4
334
function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
336
return call_user_func_array(
337
'PHPUnit_Framework_Assert::assertAttributeNotContainsOnly',
343
* Asserts the number of elements of an array, Countable or Traversable
344
* that is stored in an attribute.
346
* @param integer $expectedCount
347
* @param string $haystackAttributeName
348
* @param mixed $haystackClassOrObject
349
* @param string $message
350
* @since Method available since Release 3.6.0
352
function assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
354
return call_user_func_array(
355
'PHPUnit_Framework_Assert::assertAttributeNotCount',
361
* Asserts that a static attribute of a class or an attribute of an object
364
* @param string $haystackAttributeName
365
* @param mixed $haystackClassOrObject
366
* @param string $message
367
* @since Method available since Release 3.5.0
369
function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
371
return call_user_func_array(
372
'PHPUnit_Framework_Assert::assertAttributeNotEmpty',
378
* Asserts that a variable is not equal to an attribute of an object.
380
* @param mixed $expected
381
* @param string $actualAttributeName
382
* @param string $actualClassOrObject
383
* @param string $message
384
* @param float $delta
385
* @param integer $maxDepth
386
* @param boolean $canonicalize
387
* @param boolean $ignoreCase
389
function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
391
return call_user_func_array(
392
'PHPUnit_Framework_Assert::assertAttributeNotEquals',
398
* Asserts that an attribute is of a given type.
400
* @param string $expected
401
* @param string $attributeName
402
* @param mixed $classOrObject
403
* @param string $message
404
* @since Method available since Release 3.5.0
406
function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '')
408
return call_user_func_array(
409
'PHPUnit_Framework_Assert::assertAttributeNotInstanceOf',
415
* Asserts that an attribute is of a given type.
417
* @param string $expected
418
* @param string $attributeName
419
* @param mixed $classOrObject
420
* @param string $message
421
* @since Method available since Release 3.5.0
423
function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '')
425
return call_user_func_array(
426
'PHPUnit_Framework_Assert::assertAttributeNotInternalType',
432
* Asserts that a variable and an attribute of an object do not have the
433
* same type and value.
435
* @param mixed $expected
436
* @param string $actualAttributeName
437
* @param object $actualClassOrObject
438
* @param string $message
440
function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
442
return call_user_func_array(
443
'PHPUnit_Framework_Assert::assertAttributeNotSame',
449
* Asserts that a variable and an attribute of an object have the same type
452
* @param mixed $expected
453
* @param string $actualAttributeName
454
* @param object $actualClassOrObject
455
* @param string $message
457
function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
459
return call_user_func_array(
460
'PHPUnit_Framework_Assert::assertAttributeSame',
466
* Asserts that a class has a specified attribute.
468
* @param string $attributeName
469
* @param string $className
470
* @param string $message
471
* @since Method available since Release 3.1.0
473
function assertClassHasAttribute($attributeName, $className, $message = '')
475
return call_user_func_array(
476
'PHPUnit_Framework_Assert::assertClassHasAttribute',
482
* Asserts that a class has a specified static attribute.
484
* @param string $attributeName
485
* @param string $className
486
* @param string $message
487
* @since Method available since Release 3.1.0
489
function assertClassHasStaticAttribute($attributeName, $className, $message = '')
491
return call_user_func_array(
492
'PHPUnit_Framework_Assert::assertClassHasStaticAttribute',
498
* Asserts that a class does not have a specified attribute.
500
* @param string $attributeName
501
* @param string $className
502
* @param string $message
503
* @since Method available since Release 3.1.0
505
function assertClassNotHasAttribute($attributeName, $className, $message = '')
507
return call_user_func_array(
508
'PHPUnit_Framework_Assert::assertClassNotHasAttribute',
514
* Asserts that a class does not have a specified static attribute.
516
* @param string $attributeName
517
* @param string $className
518
* @param string $message
519
* @since Method available since Release 3.1.0
521
function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
523
return call_user_func_array(
524
'PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute',
530
* Asserts that a haystack contains a needle.
532
* @param mixed $needle
533
* @param mixed $haystack
534
* @param string $message
535
* @param boolean $ignoreCase
536
* @param boolean $checkForObjectIdentity
537
* @param boolean $checkForNonObjectIdentity
538
* @since Method available since Release 2.1.0
540
function assertContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
542
return call_user_func_array(
543
'PHPUnit_Framework_Assert::assertContains',
549
* Asserts that a haystack contains only values of a given type.
551
* @param string $type
552
* @param mixed $haystack
553
* @param boolean $isNativeType
554
* @param string $message
555
* @since Method available since Release 3.1.4
557
function assertContainsOnly($type, $haystack, $isNativeType = null, $message = '')
559
return call_user_func_array(
560
'PHPUnit_Framework_Assert::assertContainsOnly',
566
* Asserts that a haystack contains only instances of a given classname
568
* @param string $classname
569
* @param array|Traversable $haystack
570
* @param string $message
572
function assertContainsOnlyInstancesOf($classname, $haystack, $message = '')
574
return call_user_func_array(
575
'PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf',
581
* Asserts the number of elements of an array, Countable or Traversable.
583
* @param integer $expectedCount
584
* @param mixed $haystack
585
* @param string $message
587
function assertCount($expectedCount, $haystack, $message = '')
589
return call_user_func_array(
590
'PHPUnit_Framework_Assert::assertCount',
596
* Asserts that a variable is empty.
598
* @param mixed $actual
599
* @param string $message
600
* @throws PHPUnit_Framework_AssertionFailedError
602
function assertEmpty($actual, $message = '')
604
return call_user_func_array(
605
'PHPUnit_Framework_Assert::assertEmpty',
611
* Asserts that a hierarchy of DOMElements matches.
613
* @param DOMElement $expectedElement
614
* @param DOMElement $actualElement
615
* @param boolean $checkAttributes
616
* @param string $message
617
* @author Mattis Stordalen Flister <mattis@xait.no>
618
* @since Method available since Release 3.3.0
620
function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = false, $message = '')
622
return call_user_func_array(
623
'PHPUnit_Framework_Assert::assertEqualXMLStructure',
629
* Asserts that two variables are equal.
631
* @param mixed $expected
632
* @param mixed $actual
633
* @param string $message
634
* @param float $delta
635
* @param integer $maxDepth
636
* @param boolean $canonicalize
637
* @param boolean $ignoreCase
639
function assertEquals($expected, $actual, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
641
return call_user_func_array(
642
'PHPUnit_Framework_Assert::assertEquals',
648
* Asserts that a condition is not true.
650
* @param boolean $condition
651
* @param string $message
652
* @throws PHPUnit_Framework_AssertionFailedError
654
function assertNotTrue($condition, $message = '')
656
return call_user_func_array(
657
'PHPUnit_Framework_Assert::assertNotTrue',
663
* Asserts that a condition is false.
665
* @param boolean $condition
666
* @param string $message
667
* @throws PHPUnit_Framework_AssertionFailedError
669
function assertFalse($condition, $message = '')
671
return call_user_func_array(
672
'PHPUnit_Framework_Assert::assertFalse',
678
* Asserts that the contents of one file is equal to the contents of another
681
* @param string $expected
682
* @param string $actual
683
* @param string $message
684
* @param boolean $canonicalize
685
* @param boolean $ignoreCase
686
* @since Method available since Release 3.2.14
688
function assertFileEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
690
return call_user_func_array(
691
'PHPUnit_Framework_Assert::assertFileEquals',
697
* Asserts that a file exists.
699
* @param string $filename
700
* @param string $message
701
* @since Method available since Release 3.0.0
703
function assertFileExists($filename, $message = '')
705
return call_user_func_array(
706
'PHPUnit_Framework_Assert::assertFileExists',
712
* Asserts that the contents of one file is not equal to the contents of
715
* @param string $expected
716
* @param string $actual
717
* @param string $message
718
* @param boolean $canonicalize
719
* @param boolean $ignoreCase
720
* @since Method available since Release 3.2.14
722
function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
724
return call_user_func_array(
725
'PHPUnit_Framework_Assert::assertFileNotEquals',
731
* Asserts that a file does not exist.
733
* @param string $filename
734
* @param string $message
735
* @since Method available since Release 3.0.0
737
function assertFileNotExists($filename, $message = '')
739
return call_user_func_array(
740
'PHPUnit_Framework_Assert::assertFileNotExists',
746
* Asserts that a value is greater than another value.
748
* @param mixed $expected
749
* @param mixed $actual
750
* @param string $message
751
* @since Method available since Release 3.1.0
753
function assertGreaterThan($expected, $actual, $message = '')
755
return call_user_func_array(
756
'PHPUnit_Framework_Assert::assertGreaterThan',
762
* Asserts that a value is greater than or equal to another value.
764
* @param mixed $expected
765
* @param mixed $actual
766
* @param string $message
767
* @since Method available since Release 3.1.0
769
function assertGreaterThanOrEqual($expected, $actual, $message = '')
771
return call_user_func_array(
772
'PHPUnit_Framework_Assert::assertGreaterThanOrEqual',
778
* Asserts that a variable is of a given type.
780
* @param string $expected
781
* @param mixed $actual
782
* @param string $message
783
* @since Method available since Release 3.5.0
785
function assertInstanceOf($expected, $actual, $message = '')
787
return call_user_func_array(
788
'PHPUnit_Framework_Assert::assertInstanceOf',
794
* Asserts that a variable is of a given type.
796
* @param string $expected
797
* @param mixed $actual
798
* @param string $message
799
* @since Method available since Release 3.5.0
801
function assertInternalType($expected, $actual, $message = '')
803
return call_user_func_array(
804
'PHPUnit_Framework_Assert::assertInternalType',
810
* Asserts that a string is a valid JSON string.
812
* @param string $filename
813
* @param string $message
814
* @since Method available since Release 3.7.20
816
function assertJson($expectedJson, $message = '')
818
return call_user_func_array(
819
'PHPUnit_Framework_Assert::assertJson',
825
* Asserts that two JSON files are equal.
827
* @param string $expectedFile
828
* @param string $actualFile
829
* @param string $message
831
function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = '')
833
return call_user_func_array(
834
'PHPUnit_Framework_Assert::assertJsonFileEqualsJsonFile',
840
* Asserts that two JSON files are not equal.
842
* @param string $expectedFile
843
* @param string $actualFile
844
* @param string $message
846
function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = '')
848
return call_user_func_array(
849
'PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile',
855
* Asserts that the generated JSON encoded object and the content of the given file are equal.
857
* @param string $expectedFile
858
* @param string $actualJson
859
* @param string $message
861
function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = '')
863
return call_user_func_array(
864
'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile',
870
* Asserts that two given JSON encoded objects or arrays are equal.
872
* @param string $expectedJson
873
* @param string $actualJson
874
* @param string $message
876
function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = '')
878
return call_user_func_array(
879
'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString',
885
* Asserts that the generated JSON encoded object and the content of the given file are not equal.
887
* @param string $expectedFile
888
* @param string $actualJson
889
* @param string $message
891
function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = '')
893
return call_user_func_array(
894
'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile',
900
* Asserts that two given JSON encoded objects or arrays are not equal.
902
* @param string $expectedJson
903
* @param string $actualJson
904
* @param string $message
906
function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = '')
908
return call_user_func_array(
909
'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString',
915
* Asserts that a value is smaller than another value.
917
* @param mixed $expected
918
* @param mixed $actual
919
* @param string $message
920
* @since Method available since Release 3.1.0
922
function assertLessThan($expected, $actual, $message = '')
924
return call_user_func_array(
925
'PHPUnit_Framework_Assert::assertLessThan',
931
* Asserts that a value is smaller than or equal to another value.
933
* @param mixed $expected
934
* @param mixed $actual
935
* @param string $message
936
* @since Method available since Release 3.1.0
938
function assertLessThanOrEqual($expected, $actual, $message = '')
940
return call_user_func_array(
941
'PHPUnit_Framework_Assert::assertLessThanOrEqual',
947
* Asserts that a haystack does not contain a needle.
949
* @param mixed $needle
950
* @param mixed $haystack
951
* @param string $message
952
* @param boolean $ignoreCase
953
* @param boolean $checkForObjectIdentity
954
* @param boolean $checkForNonObjectIdentity
955
* @since Method available since Release 2.1.0
957
function assertNotContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
959
return call_user_func_array(
960
'PHPUnit_Framework_Assert::assertNotContains',
966
* Asserts that a haystack does not contain only values of a given type.
968
* @param string $type
969
* @param mixed $haystack
970
* @param boolean $isNativeType
971
* @param string $message
972
* @since Method available since Release 3.1.4
974
function assertNotContainsOnly($type, $haystack, $isNativeType = null, $message = '')
976
return call_user_func_array(
977
'PHPUnit_Framework_Assert::assertNotContainsOnly',
983
* Asserts the number of elements of an array, Countable or Traversable.
985
* @param integer $expectedCount
986
* @param mixed $haystack
987
* @param string $message
989
function assertNotCount($expectedCount, $haystack, $message = '')
991
return call_user_func_array(
992
'PHPUnit_Framework_Assert::assertNotCount',
998
* Asserts that a variable is not empty.
1000
* @param mixed $actual
1001
* @param string $message
1002
* @throws PHPUnit_Framework_AssertionFailedError
1004
function assertNotEmpty($actual, $message = '')
1006
return call_user_func_array(
1007
'PHPUnit_Framework_Assert::assertNotEmpty',
1013
* Asserts that two variables are not equal.
1015
* @param mixed $expected
1016
* @param mixed $actual
1017
* @param string $message
1018
* @param float $delta
1019
* @param integer $maxDepth
1020
* @param boolean $canonicalize
1021
* @param boolean $ignoreCase
1022
* @since Method available since Release 2.3.0
1024
function assertNotEquals($expected, $actual, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
1026
return call_user_func_array(
1027
'PHPUnit_Framework_Assert::assertNotEquals',
1033
* Asserts that a variable is not of a given type.
1035
* @param string $expected
1036
* @param mixed $actual
1037
* @param string $message
1038
* @since Method available since Release 3.5.0
1040
function assertNotInstanceOf($expected, $actual, $message = '')
1042
return call_user_func_array(
1043
'PHPUnit_Framework_Assert::assertNotInstanceOf',
1049
* Asserts that a variable is not of a given type.
1051
* @param string $expected
1052
* @param mixed $actual
1053
* @param string $message
1054
* @since Method available since Release 3.5.0
1056
function assertNotInternalType($expected, $actual, $message = '')
1058
return call_user_func_array(
1059
'PHPUnit_Framework_Assert::assertNotInternalType',
1065
* Asserts that a condition is not false.
1067
* @param boolean $condition
1068
* @param string $message
1069
* @throws PHPUnit_Framework_AssertionFailedError
1071
function assertNotFalse($condition, $message = '')
1073
return call_user_func_array(
1074
'PHPUnit_Framework_Assert::assertNotFalse',
1080
* Asserts that a variable is not null.
1082
* @param mixed $actual
1083
* @param string $message
1085
function assertNotNull($actual, $message = '')
1087
return call_user_func_array(
1088
'PHPUnit_Framework_Assert::assertNotNull',
1094
* Asserts that a string does not match a given regular expression.
1096
* @param string $pattern
1097
* @param string $string
1098
* @param string $message
1099
* @since Method available since Release 2.1.0
1101
function assertNotRegExp($pattern, $string, $message = '')
1103
return call_user_func_array(
1104
'PHPUnit_Framework_Assert::assertNotRegExp',
1110
* Asserts that two variables do not have the same type and value.
1111
* Used on objects, it asserts that two variables do not reference
1114
* @param mixed $expected
1115
* @param mixed $actual
1116
* @param string $message
1118
function assertNotSame($expected, $actual, $message = '')
1120
return call_user_func_array(
1121
'PHPUnit_Framework_Assert::assertNotSame',
1127
* Assert that the size of two arrays (or `Countable` or `Traversable` objects)
1130
* @param array|Countable|Traversable $expected
1131
* @param array|Countable|Traversable $actual
1132
* @param string $message
1134
function assertNotSameSize($expected, $actual, $message = '')
1136
return call_user_func_array(
1137
'PHPUnit_Framework_Assert::assertNotSameSize',
1143
* This assertion is the exact opposite of assertTag().
1145
* Rather than asserting that $matcher results in a match, it asserts that
1146
* $matcher does not match.
1148
* @param array $matcher
1149
* @param string $actual
1150
* @param string $message
1151
* @param boolean $isHtml
1152
* @since Method available since Release 3.3.0
1153
* @author Mike Naberezny <mike@maintainable.com>
1154
* @author Derek DeVries <derek@maintainable.com>
1156
function assertNotTag($matcher, $actual, $message = '', $isHtml = true)
1158
return call_user_func_array(
1159
'PHPUnit_Framework_Assert::assertNotTag',
1165
* Asserts that a variable is null.
1167
* @param mixed $actual
1168
* @param string $message
1170
function assertNull($actual, $message = '')
1172
return call_user_func_array(
1173
'PHPUnit_Framework_Assert::assertNull',
1179
* Asserts that an object has a specified attribute.
1181
* @param string $attributeName
1182
* @param object $object
1183
* @param string $message
1184
* @since Method available since Release 3.0.0
1186
function assertObjectHasAttribute($attributeName, $object, $message = '')
1188
return call_user_func_array(
1189
'PHPUnit_Framework_Assert::assertObjectHasAttribute',
1195
* Asserts that an object does not have a specified attribute.
1197
* @param string $attributeName
1198
* @param object $object
1199
* @param string $message
1200
* @since Method available since Release 3.0.0
1202
function assertObjectNotHasAttribute($attributeName, $object, $message = '')
1204
return call_user_func_array(
1205
'PHPUnit_Framework_Assert::assertObjectNotHasAttribute',
1211
* Asserts that a string matches a given regular expression.
1213
* @param string $pattern
1214
* @param string $string
1215
* @param string $message
1217
function assertRegExp($pattern, $string, $message = '')
1219
return call_user_func_array(
1220
'PHPUnit_Framework_Assert::assertRegExp',
1226
* Asserts that two variables have the same type and value.
1227
* Used on objects, it asserts that two variables reference
1230
* @param mixed $expected
1231
* @param mixed $actual
1232
* @param string $message
1234
function assertSame($expected, $actual, $message = '')
1236
return call_user_func_array(
1237
'PHPUnit_Framework_Assert::assertSame',
1243
* Assert that the size of two arrays (or `Countable` or `Traversable` objects)
1246
* @param array|Countable|Traversable $expected
1247
* @param array|Countable|Traversable $actual
1248
* @param string $message
1250
function assertSameSize($expected, $actual, $message = '')
1252
return call_user_func_array(
1253
'PHPUnit_Framework_Assert::assertSameSize',
1259
* Assert the presence, absence, or count of elements in a document matching
1260
* the CSS $selector, regardless of the contents of those elements.
1262
* The first argument, $selector, is the CSS selector used to match
1263
* the elements in the $actual document.
1265
* The second argument, $count, can be either boolean or numeric.
1266
* When boolean, it asserts for presence of elements matching the selector
1267
* (true) or absence of elements (false).
1268
* When numeric, it asserts the count of elements.
1270
* assertSelectCount("#binder", true, $xml); // any?
1271
* assertSelectCount(".binder", 3, $xml); // exactly 3?
1273
* @param array $selector
1274
* @param integer $count
1275
* @param mixed $actual
1276
* @param string $message
1277
* @param boolean $isHtml
1278
* @since Method available since Release 3.3.0
1279
* @author Mike Naberezny <mike@maintainable.com>
1280
* @author Derek DeVries <derek@maintainable.com>
1282
function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = true)
1284
return call_user_func_array(
1285
'PHPUnit_Framework_Assert::assertSelectCount',
1291
* assertSelectEquals("#binder .name", "Chuck", true, $xml); // any?
1292
* assertSelectEquals("#binder .name", "Chuck", false, $xml); // none?
1294
* @param array $selector
1295
* @param string $content
1296
* @param integer $count
1297
* @param mixed $actual
1298
* @param string $message
1299
* @param boolean $isHtml
1300
* @since Method available since Release 3.3.0
1301
* @author Mike Naberezny <mike@maintainable.com>
1302
* @author Derek DeVries <derek@maintainable.com>
1304
function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = true)
1306
return call_user_func_array(
1307
'PHPUnit_Framework_Assert::assertSelectEquals',
1313
* assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
1314
* assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
1316
* @param array $selector
1317
* @param string $pattern
1318
* @param integer $count
1319
* @param mixed $actual
1320
* @param string $message
1321
* @param boolean $isHtml
1322
* @since Method available since Release 3.3.0
1323
* @author Mike Naberezny <mike@maintainable.com>
1324
* @author Derek DeVries <derek@maintainable.com>
1326
function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = true)
1328
return call_user_func_array(
1329
'PHPUnit_Framework_Assert::assertSelectRegExp',
1335
* Asserts that a string ends not with a given prefix.
1337
* @param string $suffix
1338
* @param string $string
1339
* @param string $message
1340
* @since Method available since Release 3.4.0
1342
function assertStringEndsNotWith($suffix, $string, $message = '')
1344
return call_user_func_array(
1345
'PHPUnit_Framework_Assert::assertStringEndsNotWith',
1351
* Asserts that a string ends with a given prefix.
1353
* @param string $suffix
1354
* @param string $string
1355
* @param string $message
1356
* @since Method available since Release 3.4.0
1358
function assertStringEndsWith($suffix, $string, $message = '')
1360
return call_user_func_array(
1361
'PHPUnit_Framework_Assert::assertStringEndsWith',
1367
* Asserts that the contents of a string is equal
1368
* to the contents of a file.
1370
* @param string $expectedFile
1371
* @param string $actualString
1372
* @param string $message
1373
* @param boolean $canonicalize
1374
* @param boolean $ignoreCase
1375
* @since Method available since Release 3.3.0
1377
function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
1379
return call_user_func_array(
1380
'PHPUnit_Framework_Assert::assertStringEqualsFile',
1386
* Asserts that a string matches a given format string.
1388
* @param string $format
1389
* @param string $string
1390
* @param string $message
1391
* @since Method available since Release 3.5.0
1393
function assertStringMatchesFormat($format, $string, $message = '')
1395
return call_user_func_array(
1396
'PHPUnit_Framework_Assert::assertStringMatchesFormat',
1402
* Asserts that a string matches a given format file.
1404
* @param string $formatFile
1405
* @param string $string
1406
* @param string $message
1407
* @since Method available since Release 3.5.0
1409
function assertStringMatchesFormatFile($formatFile, $string, $message = '')
1411
return call_user_func_array(
1412
'PHPUnit_Framework_Assert::assertStringMatchesFormatFile',
1418
* Asserts that the contents of a string is not equal
1419
* to the contents of a file.
1421
* @param string $expectedFile
1422
* @param string $actualString
1423
* @param string $message
1424
* @param boolean $canonicalize
1425
* @param boolean $ignoreCase
1426
* @since Method available since Release 3.3.0
1428
function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
1430
return call_user_func_array(
1431
'PHPUnit_Framework_Assert::assertStringNotEqualsFile',
1437
* Asserts that a string does not match a given format string.
1439
* @param string $format
1440
* @param string $string
1441
* @param string $message
1442
* @since Method available since Release 3.5.0
1444
function assertStringNotMatchesFormat($format, $string, $message = '')
1446
return call_user_func_array(
1447
'PHPUnit_Framework_Assert::assertStringNotMatchesFormat',
1453
* Asserts that a string does not match a given format string.
1455
* @param string $formatFile
1456
* @param string $string
1457
* @param string $message
1458
* @since Method available since Release 3.5.0
1460
function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
1462
return call_user_func_array(
1463
'PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile',
1469
* Asserts that a string starts not with a given prefix.
1471
* @param string $prefix
1472
* @param string $string
1473
* @param string $message
1474
* @since Method available since Release 3.4.0
1476
function assertStringStartsNotWith($prefix, $string, $message = '')
1478
return call_user_func_array(
1479
'PHPUnit_Framework_Assert::assertStringStartsNotWith',
1485
* Asserts that a string starts with a given prefix.
1487
* @param string $prefix
1488
* @param string $string
1489
* @param string $message
1490
* @since Method available since Release 3.4.0
1492
function assertStringStartsWith($prefix, $string, $message = '')
1494
return call_user_func_array(
1495
'PHPUnit_Framework_Assert::assertStringStartsWith',
1501
* Evaluate an HTML or XML string and assert its structure and/or contents.
1503
* The first argument ($matcher) is an associative array that specifies the
1504
* match criteria for the assertion:
1506
* - `id` : the node with the given id attribute must match the
1507
* corresponding value.
1508
* - `tag` : the node type must match the corresponding value.
1509
* - `attributes` : a hash. The node's attributes must match the
1510
* corresponding values in the hash.
1511
* - `content` : The text content must match the given value.
1512
* - `parent` : a hash. The node's parent must match the
1513
* corresponding hash.
1514
* - `child`: a hash. At least one of the node's immediate children
1515
* must meet the criteria described by the hash.
1516
* - `ancestor` : a hash. At least one of the node's ancestors must
1517
* meet the criteria described by the hash.
1518
* - `descendant` : a hash. At least one of the node's descendants must
1519
* meet the criteria described by the hash.
1520
* - `children` : a hash, for counting children of a node.
1522
*- `count`: a number which must equal the number of children
1524
*- `less_than`: the number of matching children must be greater
1526
*- `greater_than` : the number of matching children must be less than
1528
*- `only` : another hash consisting of the keys to use to match
1529
* on the children, and only matching children will be
1533
* // Matcher that asserts that there is an element with an id="my_id".
1534
* $matcher = array('id' => 'my_id');
1536
* // Matcher that asserts that there is a "span" tag.
1537
* $matcher = array('tag' => 'span');
1539
* // Matcher that asserts that there is a "span" tag with the content
1541
* $matcher = array('tag' => 'span', 'content' => 'Hello World');
1543
* // Matcher that asserts that there is a "span" tag with content matching
1544
* // the regular expression pattern.
1545
* $matcher = array('tag' => 'span', 'content' => 'regexp:/Try P(HP|ython)/');
1547
* // Matcher that asserts that there is a "span" with an "list" class
1551
* 'attributes' => array('class' => 'list')
1554
* // Matcher that asserts that there is a "span" inside of a "div".
1557
* 'parent' => array('tag' => 'div')
1560
* // Matcher that asserts that there is a "span" somewhere inside a
1564
* 'ancestor' => array('tag' => 'table')
1567
* // Matcher that asserts that there is a "span" with at least one "em"
1571
* 'child' => array('tag' => 'em')
1574
* // Matcher that asserts that there is a "span" containing a (possibly
1575
* // nested) "strong" tag.
1578
* 'descendant' => array('tag' => 'strong')
1581
* // Matcher that asserts that there is a "span" containing 5-10 "em" tags
1582
* // as immediate children.
1585
* 'children' => array(
1587
* 'greater_than' => 4,
1588
* 'only' => array('tag' => 'em')
1592
* // Matcher that asserts that there is a "div", with an "ul" ancestor and
1593
* // a "li" parent (with class="enum"), and containing a "span" descendant
1594
* // that contains an element with id="my_test" and the text "Hello World".
1597
* 'ancestor' => array('tag' => 'ul'),
1598
* 'parent' => array(
1600
* 'attributes' => array('class' => 'enum')
1602
* 'descendant' => array(
1605
* 'id' => 'my_test',
1606
* 'content' => 'Hello World'
1611
* // Use assertTag() to apply a $matcher to a piece of $html.
1612
* $this->assertTag($matcher, $html);
1614
* // Use assertTag() to apply a $matcher to a piece of $xml.
1615
* $this->assertTag($matcher, $xml, '', false);
1618
* The second argument ($actual) is a string containing either HTML or
1619
* XML text to be tested.
1621
* The third argument ($message) is an optional message that will be
1622
* used if the assertion fails.
1624
* The fourth argument ($html) is an optional flag specifying whether
1625
* to load the $actual string into a DOMDocument using the HTML or
1626
* XML load strategy. It is true by default, which assumes the HTML
1627
* load strategy. In many cases, this will be acceptable for XML as well.
1629
* @param array $matcher
1630
* @param string $actual
1631
* @param string $message
1632
* @param boolean $isHtml
1633
* @since Method available since Release 3.3.0
1634
* @author Mike Naberezny <mike@maintainable.com>
1635
* @author Derek DeVries <derek@maintainable.com>
1637
function assertTag($matcher, $actual, $message = '', $isHtml = true)
1639
return call_user_func_array(
1640
'PHPUnit_Framework_Assert::assertTag',
1646
* Evaluates a PHPUnit_Framework_Constraint matcher object.
1648
* @param mixed$value
1649
* @param PHPUnit_Framework_Constraint $constraint
1650
* @param string $message
1651
* @since Method available since Release 3.0.0
1653
function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
1655
return call_user_func_array(
1656
'PHPUnit_Framework_Assert::assertThat',
1662
* Asserts that a condition is true.
1664
* @param boolean $condition
1665
* @param string $message
1666
* @throws PHPUnit_Framework_AssertionFailedError
1668
function assertTrue($condition, $message = '')
1670
return call_user_func_array(
1671
'PHPUnit_Framework_Assert::assertTrue',
1677
* Asserts that two XML files are equal.
1679
* @param string $expectedFile
1680
* @param string $actualFile
1681
* @param string $message
1682
* @since Method available since Release 3.1.0
1684
function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
1686
return call_user_func_array(
1687
'PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile',
1693
* Asserts that two XML files are not equal.
1695
* @param string $expectedFile
1696
* @param string $actualFile
1697
* @param string $message
1698
* @since Method available since Release 3.1.0
1700
function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
1702
return call_user_func_array(
1703
'PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile',
1709
* Asserts that two XML documents are equal.
1711
* @param string $expectedFile
1712
* @param string $actualXml
1713
* @param string $message
1714
* @since Method available since Release 3.3.0
1716
function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
1718
return call_user_func_array(
1719
'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile',
1725
* Asserts that two XML documents are equal.
1727
* @param string $expectedXml
1728
* @param string $actualXml
1729
* @param string $message
1730
* @since Method available since Release 3.1.0
1732
function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
1734
return call_user_func_array(
1735
'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString',
1741
* Asserts that two XML documents are not equal.
1743
* @param string $expectedFile
1744
* @param string $actualXml
1745
* @param string $message
1746
* @since Method available since Release 3.3.0
1748
function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
1750
return call_user_func_array(
1751
'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile',
1757
* Asserts that two XML documents are not equal.
1759
* @param string $expectedXml
1760
* @param string $actualXml
1761
* @param string $message
1762
* @since Method available since Release 3.1.0
1764
function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
1766
return call_user_func_array(
1767
'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString',
1773
* Returns a matcher that matches when the method it is evaluated for
1774
* is invoked at the given $index.
1776
* @param integer $index
1777
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
1778
* @since Method available since Release 3.0.0
1782
return call_user_func_array(
1783
'PHPUnit_Framework_TestCase::at',
1789
* Returns a matcher that matches when the method it is evaluated for
1790
* is executed at least once.
1792
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
1793
* @since Method available since Release 3.0.0
1795
function atLeastOnce()
1797
return call_user_func_array(
1798
'PHPUnit_Framework_TestCase::atLeastOnce',
1804
* Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
1806
* @param PHPUnit_Framework_Constraint $constraint
1807
* @param string $attributeName
1808
* @return PHPUnit_Framework_Constraint_Attribute
1809
* @since Method available since Release 3.1.0
1811
function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
1813
return call_user_func_array(
1814
'PHPUnit_Framework_Assert::attribute',
1820
* Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
1821
* that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
1824
* @param string $attributeName
1825
* @param mixed $value
1826
* @param float $delta
1827
* @param integer $maxDepth
1828
* @param boolean $canonicalize
1829
* @param boolean $ignoreCase
1830
* @return PHPUnit_Framework_Constraint_Attribute
1831
* @since Method available since Release 3.1.0
1833
function attributeEqualTo($attributeName, $value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
1835
return call_user_func_array(
1836
'PHPUnit_Framework_Assert::attributeEqualTo',
1842
* Returns a PHPUnit_Framework_Constraint_Callback matcher object.
1844
* @param callable $callback
1845
* @return PHPUnit_Framework_Constraint_Callback
1847
function callback($callback)
1849
return call_user_func_array(
1850
'PHPUnit_Framework_Assert::callback',
1856
* Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
1858
* @param string $attributeName
1859
* @return PHPUnit_Framework_Constraint_ClassHasAttribute
1860
* @since Method available since Release 3.1.0
1862
function classHasAttribute($attributeName)
1864
return call_user_func_array(
1865
'PHPUnit_Framework_Assert::classHasAttribute',
1871
* Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
1874
* @param string $attributeName
1875
* @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
1876
* @since Method available since Release 3.1.0
1878
function classHasStaticAttribute($attributeName)
1880
return call_user_func_array(
1881
'PHPUnit_Framework_Assert::classHasStaticAttribute',
1887
* Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
1890
* @param mixed $value
1891
* @param boolean $checkForObjectIdentity
1892
* @param boolean $checkForNonObjectIdentity
1893
* @return PHPUnit_Framework_Constraint_TraversableContains
1894
* @since Method available since Release 3.0.0
1896
function contains($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
1898
return call_user_func_array(
1899
'PHPUnit_Framework_Assert::contains',
1905
* Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1908
* @param string $type
1909
* @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1910
* @since Method available since Release 3.1.4
1912
function containsOnly($type)
1914
return call_user_func_array(
1915
'PHPUnit_Framework_Assert::containsOnly',
1921
* Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
1924
* @param string $classname
1925
* @return PHPUnit_Framework_Constraint_TraversableContainsOnly
1927
function containsOnlyInstancesOf($classname)
1929
return call_user_func_array(
1930
'PHPUnit_Framework_Assert::containsOnlyInstancesOf',
1936
* Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
1938
* @param mixed $value
1939
* @param float $delta
1940
* @param integer $maxDepth
1941
* @param boolean $canonicalize
1942
* @param boolean $ignoreCase
1943
* @return PHPUnit_Framework_Constraint_IsEqual
1944
* @since Method available since Release 3.0.0
1946
function equalTo($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
1948
return call_user_func_array(
1949
'PHPUnit_Framework_Assert::equalTo',
1955
* Returns a matcher that matches when the method it is evaluated for
1956
* is executed exactly $count times.
1958
* @param integer $count
1959
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
1960
* @since Method available since Release 3.0.0
1962
function exactly($count)
1964
return call_user_func_array(
1965
'PHPUnit_Framework_TestCase::exactly',
1971
* Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
1973
* @return PHPUnit_Framework_Constraint_FileExists
1974
* @since Method available since Release 3.0.0
1976
function fileExists()
1978
return call_user_func_array(
1979
'PHPUnit_Framework_Assert::fileExists',
1985
* Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
1987
* @param mixed $value
1988
* @return PHPUnit_Framework_Constraint_GreaterThan
1989
* @since Method available since Release 3.0.0
1991
function greaterThan($value)
1993
return call_user_func_array(
1994
'PHPUnit_Framework_Assert::greaterThan',
2000
* Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
2001
* a PHPUnit_Framework_Constraint_IsEqual and a
2002
* PHPUnit_Framework_Constraint_GreaterThan matcher object.
2004
* @param mixed $value
2005
* @return PHPUnit_Framework_Constraint_Or
2006
* @since Method available since Release 3.1.0
2008
function greaterThanOrEqual($value)
2010
return call_user_func_array(
2011
'PHPUnit_Framework_Assert::greaterThanOrEqual',
2017
* Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
2019
* @param mixed $value
2020
* @return PHPUnit_Framework_Constraint_IsIdentical
2021
* @since Method available since Release 3.0.0
2023
function identicalTo($value)
2025
return call_user_func_array(
2026
'PHPUnit_Framework_Assert::identicalTo',
2032
* Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
2034
* @return PHPUnit_Framework_Constraint_IsEmpty
2035
* @since Method available since Release 3.5.0
2039
return call_user_func_array(
2040
'PHPUnit_Framework_Assert::isEmpty',
2046
* Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
2048
* @return PHPUnit_Framework_Constraint_IsFalse
2049
* @since Method available since Release 3.3.0
2053
return call_user_func_array(
2054
'PHPUnit_Framework_Assert::isFalse',
2060
* Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
2062
* @param string $className
2063
* @return PHPUnit_Framework_Constraint_IsInstanceOf
2064
* @since Method available since Release 3.0.0
2066
function isInstanceOf($className)
2068
return call_user_func_array(
2069
'PHPUnit_Framework_Assert::isInstanceOf',
2075
* Returns a PHPUnit_Framework_Constraint_IsJson matcher object.
2077
* @return PHPUnit_Framework_Constraint_IsJson
2078
* @since Method available since Release 3.7.20
2082
return call_user_func_array(
2083
'PHPUnit_Framework_Assert::isJson',
2089
* Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
2091
* @return PHPUnit_Framework_Constraint_IsNull
2092
* @since Method available since Release 3.3.0
2096
return call_user_func_array(
2097
'PHPUnit_Framework_Assert::isNull',
2103
* Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
2105
* @return PHPUnit_Framework_Constraint_IsTrue
2106
* @since Method available since Release 3.3.0
2110
return call_user_func_array(
2111
'PHPUnit_Framework_Assert::isTrue',
2117
* Returns a PHPUnit_Framework_Constraint_IsType matcher object.
2119
* @param string $type
2120
* @return PHPUnit_Framework_Constraint_IsType
2121
* @since Method available since Release 3.0.0
2123
function isType($type)
2125
return call_user_func_array(
2126
'PHPUnit_Framework_Assert::isType',
2132
* Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
2134
* @param mixed $value
2135
* @return PHPUnit_Framework_Constraint_LessThan
2136
* @since Method available since Release 3.0.0
2138
function lessThan($value)
2140
return call_user_func_array(
2141
'PHPUnit_Framework_Assert::lessThan',
2147
* Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
2148
* a PHPUnit_Framework_Constraint_IsEqual and a
2149
* PHPUnit_Framework_Constraint_LessThan matcher object.
2151
* @param mixed $value
2152
* @return PHPUnit_Framework_Constraint_Or
2153
* @since Method available since Release 3.1.0
2155
function lessThanOrEqual($value)
2157
return call_user_func_array(
2158
'PHPUnit_Framework_Assert::lessThanOrEqual',
2164
* Returns a PHPUnit_Framework_Constraint_And matcher object.
2166
* @return PHPUnit_Framework_Constraint_And
2167
* @since Method available since Release 3.0.0
2169
function logicalAnd()
2171
return call_user_func_array(
2172
'PHPUnit_Framework_Assert::logicalAnd',
2178
* Returns a PHPUnit_Framework_Constraint_Not matcher object.
2180
* @param PHPUnit_Framework_Constraint $constraint
2181
* @return PHPUnit_Framework_Constraint_Not
2182
* @since Method available since Release 3.0.0
2184
function logicalNot(PHPUnit_Framework_Constraint $constraint)
2186
return call_user_func_array(
2187
'PHPUnit_Framework_Assert::logicalNot',
2193
* Returns a PHPUnit_Framework_Constraint_Or matcher object.
2195
* @return PHPUnit_Framework_Constraint_Or
2196
* @since Method available since Release 3.0.0
2198
function logicalOr()
2200
return call_user_func_array(
2201
'PHPUnit_Framework_Assert::logicalOr',
2207
* Returns a PHPUnit_Framework_Constraint_Xor matcher object.
2209
* @return PHPUnit_Framework_Constraint_Xor
2210
* @since Method available since Release 3.0.0
2212
function logicalXor()
2214
return call_user_func_array(
2215
'PHPUnit_Framework_Assert::logicalXor',
2221
* Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
2223
* @param string $string
2224
* @return PHPUnit_Framework_Constraint_StringMatches
2225
* @since Method available since Release 3.5.0
2227
function matches($string)
2229
return call_user_func_array(
2230
'PHPUnit_Framework_Assert::matches',
2236
* Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
2238
* @param string $pattern
2239
* @return PHPUnit_Framework_Constraint_PCREMatch
2240
* @since Method available since Release 3.0.0
2242
function matchesRegularExpression($pattern)
2244
return call_user_func_array(
2245
'PHPUnit_Framework_Assert::matchesRegularExpression',
2251
* Returns a matcher that matches when the method it is evaluated for
2252
* is never executed.
2254
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
2255
* @since Method available since Release 3.0.0
2259
return call_user_func_array(
2260
'PHPUnit_Framework_TestCase::never',
2266
* Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
2268
* @param string $attributeName
2269
* @return PHPUnit_Framework_Constraint_ObjectHasAttribute
2270
* @since Method available since Release 3.0.0
2272
function objectHasAttribute($attributeName)
2274
return call_user_func_array(
2275
'PHPUnit_Framework_Assert::objectHasAttribute',
2281
* @param mixed $value, ...
2282
* @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
2283
* @since Method available since Release 3.0.0
2285
function onConsecutiveCalls()
2287
return call_user_func_array(
2288
'PHPUnit_Framework_TestCase::onConsecutiveCalls',
2294
* Returns a matcher that matches when the method it is evaluated for
2295
* is executed exactly once.
2297
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
2298
* @since Method available since Release 3.0.0
2302
return call_user_func_array(
2303
'PHPUnit_Framework_TestCase::once',
2311
* @param integer $argumentIndex
2312
* @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
2313
* @since Method available since Release 3.3.0
2315
function returnArgument($argumentIndex)
2317
return call_user_func_array(
2318
'PHPUnit_Framework_TestCase::returnArgument',
2326
* @param mixed $callback
2327
* @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
2328
* @since Method available since Release 3.3.0
2330
function returnCallback($callback)
2332
return call_user_func_array(
2333
'PHPUnit_Framework_TestCase::returnCallback',
2339
* Returns the current object.
2341
* This method is useful when mocking a fluent interface.
2343
* @return PHPUnit_Framework_MockObject_Stub_ReturnSelf
2344
* @since Method available since Release 3.6.0
2346
function returnSelf()
2348
return call_user_func_array(
2349
'PHPUnit_Framework_TestCase::returnSelf',
2357
* @param mixed $value
2358
* @return PHPUnit_Framework_MockObject_Stub_Return
2359
* @since Method available since Release 3.0.0
2361
function returnValue($value)
2363
return call_user_func_array(
2364
'PHPUnit_Framework_TestCase::returnValue',
2372
* @param array $valueMap
2373
* @return PHPUnit_Framework_MockObject_Stub_ReturnValueMap
2374
* @since Method available since Release 3.6.0
2376
function returnValueMap(array $valueMap)
2378
return call_user_func_array(
2379
'PHPUnit_Framework_TestCase::returnValueMap',
2385
* Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
2387
* @param string $string
2388
* @param boolean $case
2389
* @return PHPUnit_Framework_Constraint_StringContains
2390
* @since Method available since Release 3.0.0
2392
function stringContains($string, $case = true)
2394
return call_user_func_array(
2395
'PHPUnit_Framework_Assert::stringContains',
2401
* Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
2403
* @param mixed $suffix
2404
* @return PHPUnit_Framework_Constraint_StringEndsWith
2405
* @since Method available since Release 3.4.0
2407
function stringEndsWith($suffix)
2409
return call_user_func_array(
2410
'PHPUnit_Framework_Assert::stringEndsWith',
2416
* Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
2418
* @param mixed $prefix
2419
* @return PHPUnit_Framework_Constraint_StringStartsWith
2420
* @since Method available since Release 3.4.0
2422
function stringStartsWith($prefix)
2424
return call_user_func_array(
2425
'PHPUnit_Framework_Assert::stringStartsWith',
2433
* @param Exception $exception
2434
* @return PHPUnit_Framework_MockObject_Stub_Exception
2435
* @since Method available since Release 3.1.0
2437
function throwException(Exception $exception)
2439
return call_user_func_array(
2440
'PHPUnit_Framework_TestCase::throwException',