~jsing/wordpress/openstack-objectstorage-revert

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/src/Framework/Assert/Functions.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of PHPUnit.
 
4
 *
 
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 
6
 *
 
7
 * For the full copyright and license information, please view the LICENSE
 
8
 * file that was distributed with this source code.
 
9
 */
 
10
 
 
11
/**
 
12
 * Returns a matcher that matches when the method it is evaluated for
 
13
 * is executed zero or more times.
 
14
 *
 
15
 * @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
 
16
 * @since  Method available since Release 3.0.0
 
17
 */
 
18
function any()
 
19
{
 
20
    return call_user_func_array(
 
21
        'PHPUnit_Framework_TestCase::any',
 
22
        func_get_args()
 
23
    );
 
24
}
 
25
 
 
26
/**
 
27
 * Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
 
28
 *
 
29
 * @return PHPUnit_Framework_Constraint_IsAnything
 
30
 * @since  Method available since Release 3.0.0
 
31
 */
 
32
function anything()
 
33
{
 
34
    return call_user_func_array(
 
35
        'PHPUnit_Framework_Assert::anything',
 
36
        func_get_args()
 
37
    );
 
38
}
 
39
 
 
40
/**
 
41
 * Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
 
42
 *
 
43
 * @param  mixed $key
 
44
 * @return PHPUnit_Framework_Constraint_ArrayHasKey
 
45
 * @since  Method available since Release 3.0.0
 
46
 */
 
47
function arrayHasKey($key)
 
48
{
 
49
    return call_user_func_array(
 
50
        'PHPUnit_Framework_Assert::arrayHasKey',
 
51
        func_get_args()
 
52
    );
 
53
}
 
54
 
 
55
/**
 
56
 * Asserts that an array has a specified key.
 
57
 *
 
58
 * @param  mixed  $key
 
59
 * @param  array|ArrayAccess  $array
 
60
 * @param  string $message
 
61
 * @since  Method available since Release 3.0.0
 
62
 */
 
63
function assertArrayHasKey($key, $array, $message = '')
 
64
{
 
65
    return call_user_func_array(
 
66
        'PHPUnit_Framework_Assert::assertArrayHasKey',
 
67
        func_get_args()
 
68
    );
 
69
}
 
70
 
 
71
/**
 
72
 * Asserts that an array has a specified subset.
 
73
 *
 
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
 
79
 */
 
80
function assertArraySubset($subset, $array, $strict = false, $message = '')
 
81
{
 
82
    return call_user_func_array(
 
83
        'PHPUnit_Framework_Assert::assertArraySubset',
 
84
        func_get_args()
 
85
    );
 
86
}
 
87
 
 
88
/**
 
89
 * Asserts that an array does not have a specified key.
 
90
 *
 
91
 * @param  mixed  $key
 
92
 * @param  array|ArrayAccess  $array
 
93
 * @param  string $message
 
94
 * @since  Method available since Release 3.0.0
 
95
 */
 
96
function assertArrayNotHasKey($key, $array, $message = '')
 
97
{
 
98
    return call_user_func_array(
 
99
        'PHPUnit_Framework_Assert::assertArrayNotHasKey',
 
100
        func_get_args()
 
101
    );
 
102
}
 
103
 
 
104
/**
 
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.
 
107
 *
 
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
 
116
 */
 
117
function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 
118
{
 
119
    return call_user_func_array(
 
120
        'PHPUnit_Framework_Assert::assertAttributeContains',
 
121
        func_get_args()
 
122
    );
 
123
}
 
124
 
 
125
/**
 
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.
 
128
 *
 
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
 
135
 */
 
136
function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
 
137
{
 
138
    return call_user_func_array(
 
139
        'PHPUnit_Framework_Assert::assertAttributeContainsOnly',
 
140
        func_get_args()
 
141
    );
 
142
}
 
143
 
 
144
/**
 
145
 * Asserts the number of elements of an array, Countable or Traversable
 
146
 * that is stored in an attribute.
 
147
 *
 
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
 
153
 */
 
154
function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
 
155
{
 
156
    return call_user_func_array(
 
157
        'PHPUnit_Framework_Assert::assertAttributeCount',
 
158
        func_get_args()
 
159
    );
 
160
}
 
161
 
 
162
/**
 
163
 * Asserts that a static attribute of a class or an attribute of an object
 
164
 * is empty.
 
165
 *
 
166
 * @param string $haystackAttributeName
 
167
 * @param mixed  $haystackClassOrObject
 
168
 * @param string $message
 
169
 * @since Method available since Release 3.5.0
 
170
 */
 
171
function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
 
172
{
 
173
    return call_user_func_array(
 
174
        'PHPUnit_Framework_Assert::assertAttributeEmpty',
 
175
        func_get_args()
 
176
    );
 
177
}
 
178
 
 
179
/**
 
180
 * Asserts that a variable is equal to an attribute of an object.
 
181
 *
 
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
 
190
 */
 
191
function assertAttributeEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
192
{
 
193
    return call_user_func_array(
 
194
        'PHPUnit_Framework_Assert::assertAttributeEquals',
 
195
        func_get_args()
 
196
    );
 
197
}
 
198
 
 
199
/**
 
200
 * Asserts that an attribute is greater than another value.
 
201
 *
 
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
 
207
 */
 
208
function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
209
{
 
210
    return call_user_func_array(
 
211
        'PHPUnit_Framework_Assert::assertAttributeGreaterThan',
 
212
        func_get_args()
 
213
    );
 
214
}
 
215
 
 
216
/**
 
217
 * Asserts that an attribute is greater than or equal to another value.
 
218
 *
 
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
 
224
 */
 
225
function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
226
{
 
227
    return call_user_func_array(
 
228
        'PHPUnit_Framework_Assert::assertAttributeGreaterThanOrEqual',
 
229
        func_get_args()
 
230
    );
 
231
}
 
232
 
 
233
/**
 
234
 * Asserts that an attribute is of a given type.
 
235
 *
 
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
 
241
 */
 
242
function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')
 
243
{
 
244
    return call_user_func_array(
 
245
        'PHPUnit_Framework_Assert::assertAttributeInstanceOf',
 
246
        func_get_args()
 
247
    );
 
248
}
 
249
 
 
250
/**
 
251
 * Asserts that an attribute is of a given type.
 
252
 *
 
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
 
258
 */
 
259
function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '')
 
260
{
 
261
    return call_user_func_array(
 
262
        'PHPUnit_Framework_Assert::assertAttributeInternalType',
 
263
        func_get_args()
 
264
    );
 
265
}
 
266
 
 
267
/**
 
268
 * Asserts that an attribute is smaller than another value.
 
269
 *
 
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
 
275
 */
 
276
function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
277
{
 
278
    return call_user_func_array(
 
279
        'PHPUnit_Framework_Assert::assertAttributeLessThan',
 
280
        func_get_args()
 
281
    );
 
282
}
 
283
 
 
284
/**
 
285
 * Asserts that an attribute is smaller than or equal to another value.
 
286
 *
 
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
 
292
 */
 
293
function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
294
{
 
295
    return call_user_func_array(
 
296
        'PHPUnit_Framework_Assert::assertAttributeLessThanOrEqual',
 
297
        func_get_args()
 
298
    );
 
299
}
 
300
 
 
301
/**
 
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.
 
304
 *
 
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
 
313
 */
 
314
function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 
315
{
 
316
    return call_user_func_array(
 
317
        'PHPUnit_Framework_Assert::assertAttributeNotContains',
 
318
        func_get_args()
 
319
    );
 
320
}
 
321
 
 
322
/**
 
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
 
325
 * type.
 
326
 *
 
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
 
333
 */
 
334
function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
 
335
{
 
336
    return call_user_func_array(
 
337
        'PHPUnit_Framework_Assert::assertAttributeNotContainsOnly',
 
338
        func_get_args()
 
339
    );
 
340
}
 
341
 
 
342
/**
 
343
 * Asserts the number of elements of an array, Countable or Traversable
 
344
 * that is stored in an attribute.
 
345
 *
 
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
 
351
 */
 
352
function assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
 
353
{
 
354
    return call_user_func_array(
 
355
        'PHPUnit_Framework_Assert::assertAttributeNotCount',
 
356
        func_get_args()
 
357
    );
 
358
}
 
359
 
 
360
/**
 
361
 * Asserts that a static attribute of a class or an attribute of an object
 
362
 * is not empty.
 
363
 *
 
364
 * @param string $haystackAttributeName
 
365
 * @param mixed  $haystackClassOrObject
 
366
 * @param string $message
 
367
 * @since Method available since Release 3.5.0
 
368
 */
 
369
function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
 
370
{
 
371
    return call_user_func_array(
 
372
        'PHPUnit_Framework_Assert::assertAttributeNotEmpty',
 
373
        func_get_args()
 
374
    );
 
375
}
 
376
 
 
377
/**
 
378
 * Asserts that a variable is not equal to an attribute of an object.
 
379
 *
 
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
 
388
 */
 
389
function assertAttributeNotEquals($expected, $actualAttributeName, $actualClassOrObject, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
390
{
 
391
    return call_user_func_array(
 
392
        'PHPUnit_Framework_Assert::assertAttributeNotEquals',
 
393
        func_get_args()
 
394
    );
 
395
}
 
396
 
 
397
/**
 
398
 * Asserts that an attribute is of a given type.
 
399
 *
 
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
 
405
 */
 
406
function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '')
 
407
{
 
408
    return call_user_func_array(
 
409
        'PHPUnit_Framework_Assert::assertAttributeNotInstanceOf',
 
410
        func_get_args()
 
411
    );
 
412
}
 
413
 
 
414
/**
 
415
 * Asserts that an attribute is of a given type.
 
416
 *
 
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
 
422
 */
 
423
function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '')
 
424
{
 
425
    return call_user_func_array(
 
426
        'PHPUnit_Framework_Assert::assertAttributeNotInternalType',
 
427
        func_get_args()
 
428
    );
 
429
}
 
430
 
 
431
/**
 
432
 * Asserts that a variable and an attribute of an object do not have the
 
433
 * same type and value.
 
434
 *
 
435
 * @param  mixed  $expected
 
436
 * @param  string $actualAttributeName
 
437
 * @param  object $actualClassOrObject
 
438
 * @param  string $message
 
439
 */
 
440
function assertAttributeNotSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
441
{
 
442
    return call_user_func_array(
 
443
        'PHPUnit_Framework_Assert::assertAttributeNotSame',
 
444
        func_get_args()
 
445
    );
 
446
}
 
447
 
 
448
/**
 
449
 * Asserts that a variable and an attribute of an object have the same type
 
450
 * and value.
 
451
 *
 
452
 * @param  mixed  $expected
 
453
 * @param  string $actualAttributeName
 
454
 * @param  object $actualClassOrObject
 
455
 * @param  string $message
 
456
 */
 
457
function assertAttributeSame($expected, $actualAttributeName, $actualClassOrObject, $message = '')
 
458
{
 
459
    return call_user_func_array(
 
460
        'PHPUnit_Framework_Assert::assertAttributeSame',
 
461
        func_get_args()
 
462
    );
 
463
}
 
464
 
 
465
/**
 
466
 * Asserts that a class has a specified attribute.
 
467
 *
 
468
 * @param  string $attributeName
 
469
 * @param  string $className
 
470
 * @param  string $message
 
471
 * @since  Method available since Release 3.1.0
 
472
 */
 
473
function assertClassHasAttribute($attributeName, $className, $message = '')
 
474
{
 
475
    return call_user_func_array(
 
476
        'PHPUnit_Framework_Assert::assertClassHasAttribute',
 
477
        func_get_args()
 
478
    );
 
479
}
 
480
 
 
481
/**
 
482
 * Asserts that a class has a specified static attribute.
 
483
 *
 
484
 * @param  string $attributeName
 
485
 * @param  string $className
 
486
 * @param  string $message
 
487
 * @since  Method available since Release 3.1.0
 
488
 */
 
489
function assertClassHasStaticAttribute($attributeName, $className, $message = '')
 
490
{
 
491
    return call_user_func_array(
 
492
        'PHPUnit_Framework_Assert::assertClassHasStaticAttribute',
 
493
        func_get_args()
 
494
    );
 
495
}
 
496
 
 
497
/**
 
498
 * Asserts that a class does not have a specified attribute.
 
499
 *
 
500
 * @param  string $attributeName
 
501
 * @param  string $className
 
502
 * @param  string $message
 
503
 * @since  Method available since Release 3.1.0
 
504
 */
 
505
function assertClassNotHasAttribute($attributeName, $className, $message = '')
 
506
{
 
507
    return call_user_func_array(
 
508
        'PHPUnit_Framework_Assert::assertClassNotHasAttribute',
 
509
        func_get_args()
 
510
    );
 
511
}
 
512
 
 
513
/**
 
514
 * Asserts that a class does not have a specified static attribute.
 
515
 *
 
516
 * @param  string $attributeName
 
517
 * @param  string $className
 
518
 * @param  string $message
 
519
 * @since  Method available since Release 3.1.0
 
520
 */
 
521
function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
 
522
{
 
523
    return call_user_func_array(
 
524
        'PHPUnit_Framework_Assert::assertClassNotHasStaticAttribute',
 
525
        func_get_args()
 
526
    );
 
527
}
 
528
 
 
529
/**
 
530
 * Asserts that a haystack contains a needle.
 
531
 *
 
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
 
539
 */
 
540
function assertContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 
541
{
 
542
    return call_user_func_array(
 
543
        'PHPUnit_Framework_Assert::assertContains',
 
544
        func_get_args()
 
545
    );
 
546
}
 
547
 
 
548
/**
 
549
 * Asserts that a haystack contains only values of a given type.
 
550
 *
 
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
 
556
 */
 
557
function assertContainsOnly($type, $haystack, $isNativeType = null, $message = '')
 
558
{
 
559
    return call_user_func_array(
 
560
        'PHPUnit_Framework_Assert::assertContainsOnly',
 
561
        func_get_args()
 
562
    );
 
563
}
 
564
 
 
565
/**
 
566
 * Asserts that a haystack contains only instances of a given classname
 
567
 *
 
568
 * @param string $classname
 
569
 * @param array|Traversable $haystack
 
570
 * @param string $message
 
571
 */
 
572
function assertContainsOnlyInstancesOf($classname, $haystack, $message = '')
 
573
{
 
574
    return call_user_func_array(
 
575
        'PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf',
 
576
        func_get_args()
 
577
    );
 
578
}
 
579
 
 
580
/**
 
581
 * Asserts the number of elements of an array, Countable or Traversable.
 
582
 *
 
583
 * @param integer $expectedCount
 
584
 * @param mixed   $haystack
 
585
 * @param string  $message
 
586
 */
 
587
function assertCount($expectedCount, $haystack, $message = '')
 
588
{
 
589
    return call_user_func_array(
 
590
        'PHPUnit_Framework_Assert::assertCount',
 
591
        func_get_args()
 
592
    );
 
593
}
 
594
 
 
595
/**
 
596
 * Asserts that a variable is empty.
 
597
 *
 
598
 * @param  mixed   $actual
 
599
 * @param  string  $message
 
600
 * @throws PHPUnit_Framework_AssertionFailedError
 
601
 */
 
602
function assertEmpty($actual, $message = '')
 
603
{
 
604
    return call_user_func_array(
 
605
        'PHPUnit_Framework_Assert::assertEmpty',
 
606
        func_get_args()
 
607
    );
 
608
}
 
609
 
 
610
/**
 
611
 * Asserts that a hierarchy of DOMElements matches.
 
612
 *
 
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
 
619
 */
 
620
function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = false, $message = '')
 
621
{
 
622
    return call_user_func_array(
 
623
        'PHPUnit_Framework_Assert::assertEqualXMLStructure',
 
624
        func_get_args()
 
625
    );
 
626
}
 
627
 
 
628
/**
 
629
 * Asserts that two variables are equal.
 
630
 *
 
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
 
638
 */
 
639
function assertEquals($expected, $actual, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
640
{
 
641
    return call_user_func_array(
 
642
        'PHPUnit_Framework_Assert::assertEquals',
 
643
        func_get_args()
 
644
    );
 
645
}
 
646
 
 
647
/**
 
648
 * Asserts that a condition is not true.
 
649
 *
 
650
 * @param  boolean  $condition
 
651
 * @param  string   $message
 
652
 * @throws PHPUnit_Framework_AssertionFailedError
 
653
 */
 
654
function assertNotTrue($condition, $message = '')
 
655
{
 
656
    return call_user_func_array(
 
657
        'PHPUnit_Framework_Assert::assertNotTrue',
 
658
        func_get_args()
 
659
    );
 
660
}
 
661
 
 
662
/**
 
663
 * Asserts that a condition is false.
 
664
 *
 
665
 * @param  boolean  $condition
 
666
 * @param  string   $message
 
667
 * @throws PHPUnit_Framework_AssertionFailedError
 
668
 */
 
669
function assertFalse($condition, $message = '')
 
670
{
 
671
    return call_user_func_array(
 
672
        'PHPUnit_Framework_Assert::assertFalse',
 
673
        func_get_args()
 
674
    );
 
675
}
 
676
 
 
677
/**
 
678
 * Asserts that the contents of one file is equal to the contents of another
 
679
 * file.
 
680
 *
 
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
 
687
 */
 
688
function assertFileEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
 
689
{
 
690
    return call_user_func_array(
 
691
        'PHPUnit_Framework_Assert::assertFileEquals',
 
692
        func_get_args()
 
693
    );
 
694
}
 
695
 
 
696
/**
 
697
 * Asserts that a file exists.
 
698
 *
 
699
 * @param  string $filename
 
700
 * @param  string $message
 
701
 * @since  Method available since Release 3.0.0
 
702
 */
 
703
function assertFileExists($filename, $message = '')
 
704
{
 
705
    return call_user_func_array(
 
706
        'PHPUnit_Framework_Assert::assertFileExists',
 
707
        func_get_args()
 
708
    );
 
709
}
 
710
 
 
711
/**
 
712
 * Asserts that the contents of one file is not equal to the contents of
 
713
 * another file.
 
714
 *
 
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
 
721
 */
 
722
function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
 
723
{
 
724
    return call_user_func_array(
 
725
        'PHPUnit_Framework_Assert::assertFileNotEquals',
 
726
        func_get_args()
 
727
    );
 
728
}
 
729
 
 
730
/**
 
731
 * Asserts that a file does not exist.
 
732
 *
 
733
 * @param  string $filename
 
734
 * @param  string $message
 
735
 * @since  Method available since Release 3.0.0
 
736
 */
 
737
function assertFileNotExists($filename, $message = '')
 
738
{
 
739
    return call_user_func_array(
 
740
        'PHPUnit_Framework_Assert::assertFileNotExists',
 
741
        func_get_args()
 
742
    );
 
743
}
 
744
 
 
745
/**
 
746
 * Asserts that a value is greater than another value.
 
747
 *
 
748
 * @param  mixed   $expected
 
749
 * @param  mixed   $actual
 
750
 * @param  string  $message
 
751
 * @since  Method available since Release 3.1.0
 
752
 */
 
753
function assertGreaterThan($expected, $actual, $message = '')
 
754
{
 
755
    return call_user_func_array(
 
756
        'PHPUnit_Framework_Assert::assertGreaterThan',
 
757
        func_get_args()
 
758
    );
 
759
}
 
760
 
 
761
/**
 
762
 * Asserts that a value is greater than or equal to another value.
 
763
 *
 
764
 * @param  mixed   $expected
 
765
 * @param  mixed   $actual
 
766
 * @param  string  $message
 
767
 * @since  Method available since Release 3.1.0
 
768
 */
 
769
function assertGreaterThanOrEqual($expected, $actual, $message = '')
 
770
{
 
771
    return call_user_func_array(
 
772
        'PHPUnit_Framework_Assert::assertGreaterThanOrEqual',
 
773
        func_get_args()
 
774
    );
 
775
}
 
776
 
 
777
/**
 
778
 * Asserts that a variable is of a given type.
 
779
 *
 
780
 * @param string $expected
 
781
 * @param mixed  $actual
 
782
 * @param string $message
 
783
 * @since Method available since Release 3.5.0
 
784
 */
 
785
function assertInstanceOf($expected, $actual, $message = '')
 
786
{
 
787
    return call_user_func_array(
 
788
        'PHPUnit_Framework_Assert::assertInstanceOf',
 
789
        func_get_args()
 
790
    );
 
791
}
 
792
 
 
793
/**
 
794
 * Asserts that a variable is of a given type.
 
795
 *
 
796
 * @param string $expected
 
797
 * @param mixed  $actual
 
798
 * @param string $message
 
799
 * @since Method available since Release 3.5.0
 
800
 */
 
801
function assertInternalType($expected, $actual, $message = '')
 
802
{
 
803
    return call_user_func_array(
 
804
        'PHPUnit_Framework_Assert::assertInternalType',
 
805
        func_get_args()
 
806
    );
 
807
}
 
808
 
 
809
/**
 
810
 * Asserts that a string is a valid JSON string.
 
811
 *
 
812
 * @param  string $filename
 
813
 * @param  string $message
 
814
 * @since  Method available since Release 3.7.20
 
815
 */
 
816
function assertJson($expectedJson, $message = '')
 
817
{
 
818
    return call_user_func_array(
 
819
        'PHPUnit_Framework_Assert::assertJson',
 
820
        func_get_args()
 
821
    );
 
822
}
 
823
 
 
824
/**
 
825
 * Asserts that two JSON files are equal.
 
826
 *
 
827
 * @param  string $expectedFile
 
828
 * @param  string $actualFile
 
829
 * @param  string $message
 
830
 */
 
831
function assertJsonFileEqualsJsonFile($expectedFile, $actualFile, $message = '')
 
832
{
 
833
    return call_user_func_array(
 
834
        'PHPUnit_Framework_Assert::assertJsonFileEqualsJsonFile',
 
835
        func_get_args()
 
836
    );
 
837
}
 
838
 
 
839
/**
 
840
 * Asserts that two JSON files are not equal.
 
841
 *
 
842
 * @param  string $expectedFile
 
843
 * @param  string $actualFile
 
844
 * @param  string $message
 
845
 */
 
846
function assertJsonFileNotEqualsJsonFile($expectedFile, $actualFile, $message = '')
 
847
{
 
848
    return call_user_func_array(
 
849
        'PHPUnit_Framework_Assert::assertJsonFileNotEqualsJsonFile',
 
850
        func_get_args()
 
851
    );
 
852
}
 
853
 
 
854
/**
 
855
 * Asserts that the generated JSON encoded object and the content of the given file are equal.
 
856
 *
 
857
 * @param string $expectedFile
 
858
 * @param string $actualJson
 
859
 * @param string $message
 
860
 */
 
861
function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = '')
 
862
{
 
863
    return call_user_func_array(
 
864
        'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile',
 
865
        func_get_args()
 
866
    );
 
867
}
 
868
 
 
869
/**
 
870
 * Asserts that two given JSON encoded objects or arrays are equal.
 
871
 *
 
872
 * @param string $expectedJson
 
873
 * @param string $actualJson
 
874
 * @param string $message
 
875
 */
 
876
function assertJsonStringEqualsJsonString($expectedJson, $actualJson, $message = '')
 
877
{
 
878
    return call_user_func_array(
 
879
        'PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString',
 
880
        func_get_args()
 
881
    );
 
882
}
 
883
 
 
884
/**
 
885
 * Asserts that the generated JSON encoded object and the content of the given file are not equal.
 
886
 *
 
887
 * @param string $expectedFile
 
888
 * @param string $actualJson
 
889
 * @param string $message
 
890
 */
 
891
function assertJsonStringNotEqualsJsonFile($expectedFile, $actualJson, $message = '')
 
892
{
 
893
    return call_user_func_array(
 
894
        'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonFile',
 
895
        func_get_args()
 
896
    );
 
897
}
 
898
 
 
899
/**
 
900
 * Asserts that two given JSON encoded objects or arrays are not equal.
 
901
 *
 
902
 * @param string $expectedJson
 
903
 * @param string $actualJson
 
904
 * @param string $message
 
905
 */
 
906
function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = '')
 
907
{
 
908
    return call_user_func_array(
 
909
        'PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString',
 
910
        func_get_args()
 
911
    );
 
912
}
 
913
 
 
914
/**
 
915
 * Asserts that a value is smaller than another value.
 
916
 *
 
917
 * @param  mixed   $expected
 
918
 * @param  mixed   $actual
 
919
 * @param  string  $message
 
920
 * @since  Method available since Release 3.1.0
 
921
 */
 
922
function assertLessThan($expected, $actual, $message = '')
 
923
{
 
924
    return call_user_func_array(
 
925
        'PHPUnit_Framework_Assert::assertLessThan',
 
926
        func_get_args()
 
927
    );
 
928
}
 
929
 
 
930
/**
 
931
 * Asserts that a value is smaller than or equal to another value.
 
932
 *
 
933
 * @param  mixed   $expected
 
934
 * @param  mixed   $actual
 
935
 * @param  string  $message
 
936
 * @since  Method available since Release 3.1.0
 
937
 */
 
938
function assertLessThanOrEqual($expected, $actual, $message = '')
 
939
{
 
940
    return call_user_func_array(
 
941
        'PHPUnit_Framework_Assert::assertLessThanOrEqual',
 
942
        func_get_args()
 
943
    );
 
944
}
 
945
 
 
946
/**
 
947
 * Asserts that a haystack does not contain a needle.
 
948
 *
 
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
 
956
 */
 
957
function assertNotContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 
958
{
 
959
    return call_user_func_array(
 
960
        'PHPUnit_Framework_Assert::assertNotContains',
 
961
        func_get_args()
 
962
    );
 
963
}
 
964
 
 
965
/**
 
966
 * Asserts that a haystack does not contain only values of a given type.
 
967
 *
 
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
 
973
 */
 
974
function assertNotContainsOnly($type, $haystack, $isNativeType = null, $message = '')
 
975
{
 
976
    return call_user_func_array(
 
977
        'PHPUnit_Framework_Assert::assertNotContainsOnly',
 
978
        func_get_args()
 
979
    );
 
980
}
 
981
 
 
982
/**
 
983
 * Asserts the number of elements of an array, Countable or Traversable.
 
984
 *
 
985
 * @param integer $expectedCount
 
986
 * @param mixed   $haystack
 
987
 * @param string  $message
 
988
 */
 
989
function assertNotCount($expectedCount, $haystack, $message = '')
 
990
{
 
991
    return call_user_func_array(
 
992
        'PHPUnit_Framework_Assert::assertNotCount',
 
993
        func_get_args()
 
994
    );
 
995
}
 
996
 
 
997
/**
 
998
 * Asserts that a variable is not empty.
 
999
 *
 
1000
 * @param  mixed   $actual
 
1001
 * @param  string  $message
 
1002
 * @throws PHPUnit_Framework_AssertionFailedError
 
1003
 */
 
1004
function assertNotEmpty($actual, $message = '')
 
1005
{
 
1006
    return call_user_func_array(
 
1007
        'PHPUnit_Framework_Assert::assertNotEmpty',
 
1008
        func_get_args()
 
1009
    );
 
1010
}
 
1011
 
 
1012
/**
 
1013
 * Asserts that two variables are not equal.
 
1014
 *
 
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
 
1023
 */
 
1024
function assertNotEquals($expected, $actual, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
1025
{
 
1026
    return call_user_func_array(
 
1027
        'PHPUnit_Framework_Assert::assertNotEquals',
 
1028
        func_get_args()
 
1029
    );
 
1030
}
 
1031
 
 
1032
/**
 
1033
 * Asserts that a variable is not of a given type.
 
1034
 *
 
1035
 * @param string $expected
 
1036
 * @param mixed  $actual
 
1037
 * @param string $message
 
1038
 * @since Method available since Release 3.5.0
 
1039
 */
 
1040
function assertNotInstanceOf($expected, $actual, $message = '')
 
1041
{
 
1042
    return call_user_func_array(
 
1043
        'PHPUnit_Framework_Assert::assertNotInstanceOf',
 
1044
        func_get_args()
 
1045
    );
 
1046
}
 
1047
 
 
1048
/**
 
1049
 * Asserts that a variable is not of a given type.
 
1050
 *
 
1051
 * @param string $expected
 
1052
 * @param mixed  $actual
 
1053
 * @param string $message
 
1054
 * @since Method available since Release 3.5.0
 
1055
 */
 
1056
function assertNotInternalType($expected, $actual, $message = '')
 
1057
{
 
1058
    return call_user_func_array(
 
1059
        'PHPUnit_Framework_Assert::assertNotInternalType',
 
1060
        func_get_args()
 
1061
    );
 
1062
}
 
1063
 
 
1064
/**
 
1065
 * Asserts that a condition is not false.
 
1066
 *
 
1067
 * @param  boolean  $condition
 
1068
 * @param  string   $message
 
1069
 * @throws PHPUnit_Framework_AssertionFailedError
 
1070
 */
 
1071
function assertNotFalse($condition, $message = '')
 
1072
{
 
1073
    return call_user_func_array(
 
1074
        'PHPUnit_Framework_Assert::assertNotFalse',
 
1075
        func_get_args()
 
1076
    );
 
1077
}
 
1078
 
 
1079
/**
 
1080
 * Asserts that a variable is not null.
 
1081
 *
 
1082
 * @param  mixed  $actual
 
1083
 * @param  string $message
 
1084
 */
 
1085
function assertNotNull($actual, $message = '')
 
1086
{
 
1087
    return call_user_func_array(
 
1088
        'PHPUnit_Framework_Assert::assertNotNull',
 
1089
        func_get_args()
 
1090
    );
 
1091
}
 
1092
 
 
1093
/**
 
1094
 * Asserts that a string does not match a given regular expression.
 
1095
 *
 
1096
 * @param  string $pattern
 
1097
 * @param  string $string
 
1098
 * @param  string $message
 
1099
 * @since  Method available since Release 2.1.0
 
1100
 */
 
1101
function assertNotRegExp($pattern, $string, $message = '')
 
1102
{
 
1103
    return call_user_func_array(
 
1104
        'PHPUnit_Framework_Assert::assertNotRegExp',
 
1105
        func_get_args()
 
1106
    );
 
1107
}
 
1108
 
 
1109
/**
 
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
 
1112
 * the same object.
 
1113
 *
 
1114
 * @param  mixed  $expected
 
1115
 * @param  mixed  $actual
 
1116
 * @param  string $message
 
1117
 */
 
1118
function assertNotSame($expected, $actual, $message = '')
 
1119
{
 
1120
    return call_user_func_array(
 
1121
        'PHPUnit_Framework_Assert::assertNotSame',
 
1122
        func_get_args()
 
1123
    );
 
1124
}
 
1125
 
 
1126
/**
 
1127
 * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
 
1128
 * is not the same.
 
1129
 *
 
1130
 * @param array|Countable|Traversable $expected
 
1131
 * @param array|Countable|Traversable $actual
 
1132
 * @param string $message
 
1133
 */
 
1134
function assertNotSameSize($expected, $actual, $message = '')
 
1135
{
 
1136
    return call_user_func_array(
 
1137
        'PHPUnit_Framework_Assert::assertNotSameSize',
 
1138
        func_get_args()
 
1139
    );
 
1140
}
 
1141
 
 
1142
/**
 
1143
 * This assertion is the exact opposite of assertTag().
 
1144
 *
 
1145
 * Rather than asserting that $matcher results in a match, it asserts that
 
1146
 * $matcher does not match.
 
1147
 *
 
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>
 
1155
 */
 
1156
function assertNotTag($matcher, $actual, $message = '', $isHtml = true)
 
1157
{
 
1158
    return call_user_func_array(
 
1159
        'PHPUnit_Framework_Assert::assertNotTag',
 
1160
        func_get_args()
 
1161
    );
 
1162
}
 
1163
 
 
1164
/**
 
1165
 * Asserts that a variable is null.
 
1166
 *
 
1167
 * @param  mixed  $actual
 
1168
 * @param  string $message
 
1169
 */
 
1170
function assertNull($actual, $message = '')
 
1171
{
 
1172
    return call_user_func_array(
 
1173
        'PHPUnit_Framework_Assert::assertNull',
 
1174
        func_get_args()
 
1175
    );
 
1176
}
 
1177
 
 
1178
/**
 
1179
 * Asserts that an object has a specified attribute.
 
1180
 *
 
1181
 * @param  string $attributeName
 
1182
 * @param  object $object
 
1183
 * @param  string $message
 
1184
 * @since  Method available since Release 3.0.0
 
1185
 */
 
1186
function assertObjectHasAttribute($attributeName, $object, $message = '')
 
1187
{
 
1188
    return call_user_func_array(
 
1189
        'PHPUnit_Framework_Assert::assertObjectHasAttribute',
 
1190
        func_get_args()
 
1191
    );
 
1192
}
 
1193
 
 
1194
/**
 
1195
 * Asserts that an object does not have a specified attribute.
 
1196
 *
 
1197
 * @param  string $attributeName
 
1198
 * @param  object $object
 
1199
 * @param  string $message
 
1200
 * @since  Method available since Release 3.0.0
 
1201
 */
 
1202
function assertObjectNotHasAttribute($attributeName, $object, $message = '')
 
1203
{
 
1204
    return call_user_func_array(
 
1205
        'PHPUnit_Framework_Assert::assertObjectNotHasAttribute',
 
1206
        func_get_args()
 
1207
    );
 
1208
}
 
1209
 
 
1210
/**
 
1211
 * Asserts that a string matches a given regular expression.
 
1212
 *
 
1213
 * @param  string $pattern
 
1214
 * @param  string $string
 
1215
 * @param  string $message
 
1216
 */
 
1217
function assertRegExp($pattern, $string, $message = '')
 
1218
{
 
1219
    return call_user_func_array(
 
1220
        'PHPUnit_Framework_Assert::assertRegExp',
 
1221
        func_get_args()
 
1222
    );
 
1223
}
 
1224
 
 
1225
/**
 
1226
 * Asserts that two variables have the same type and value.
 
1227
 * Used on objects, it asserts that two variables reference
 
1228
 * the same object.
 
1229
 *
 
1230
 * @param  mixed  $expected
 
1231
 * @param  mixed  $actual
 
1232
 * @param  string $message
 
1233
 */
 
1234
function assertSame($expected, $actual, $message = '')
 
1235
{
 
1236
    return call_user_func_array(
 
1237
        'PHPUnit_Framework_Assert::assertSame',
 
1238
        func_get_args()
 
1239
    );
 
1240
}
 
1241
 
 
1242
/**
 
1243
 * Assert that the size of two arrays (or `Countable` or `Traversable` objects)
 
1244
 * is the same.
 
1245
 *
 
1246
 * @param array|Countable|Traversable $expected
 
1247
 * @param array|Countable|Traversable $actual
 
1248
 * @param string $message
 
1249
 */
 
1250
function assertSameSize($expected, $actual, $message = '')
 
1251
{
 
1252
    return call_user_func_array(
 
1253
        'PHPUnit_Framework_Assert::assertSameSize',
 
1254
        func_get_args()
 
1255
    );
 
1256
}
 
1257
 
 
1258
/**
 
1259
 * Assert the presence, absence, or count of elements in a document matching
 
1260
 * the CSS $selector, regardless of the contents of those elements.
 
1261
 *
 
1262
 * The first argument, $selector, is the CSS selector used to match
 
1263
 * the elements in the $actual document.
 
1264
 *
 
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.
 
1269
 *
 
1270
 * assertSelectCount("#binder", true, $xml);  // any?
 
1271
 * assertSelectCount(".binder", 3, $xml); // exactly 3?
 
1272
 *
 
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>
 
1281
 */
 
1282
function assertSelectCount($selector, $count, $actual, $message = '', $isHtml = true)
 
1283
{
 
1284
    return call_user_func_array(
 
1285
        'PHPUnit_Framework_Assert::assertSelectCount',
 
1286
        func_get_args()
 
1287
    );
 
1288
}
 
1289
 
 
1290
/**
 
1291
 * assertSelectEquals("#binder .name", "Chuck", true,  $xml);  // any?
 
1292
 * assertSelectEquals("#binder .name", "Chuck", false, $xml);  // none?
 
1293
 *
 
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>
 
1303
 */
 
1304
function assertSelectEquals($selector, $content, $count, $actual, $message = '', $isHtml = true)
 
1305
{
 
1306
    return call_user_func_array(
 
1307
        'PHPUnit_Framework_Assert::assertSelectEquals',
 
1308
        func_get_args()
 
1309
    );
 
1310
}
 
1311
 
 
1312
/**
 
1313
 * assertSelectRegExp("#binder .name", "/Mike|Derek/", true, $xml); // any?
 
1314
 * assertSelectRegExp("#binder .name", "/Mike|Derek/", 3, $xml);// 3?
 
1315
 *
 
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>
 
1325
 */
 
1326
function assertSelectRegExp($selector, $pattern, $count, $actual, $message = '', $isHtml = true)
 
1327
{
 
1328
    return call_user_func_array(
 
1329
        'PHPUnit_Framework_Assert::assertSelectRegExp',
 
1330
        func_get_args()
 
1331
    );
 
1332
}
 
1333
 
 
1334
/**
 
1335
 * Asserts that a string ends not with a given prefix.
 
1336
 *
 
1337
 * @param  string $suffix
 
1338
 * @param  string $string
 
1339
 * @param  string $message
 
1340
 * @since  Method available since Release 3.4.0
 
1341
 */
 
1342
function assertStringEndsNotWith($suffix, $string, $message = '')
 
1343
{
 
1344
    return call_user_func_array(
 
1345
        'PHPUnit_Framework_Assert::assertStringEndsNotWith',
 
1346
        func_get_args()
 
1347
    );
 
1348
}
 
1349
 
 
1350
/**
 
1351
 * Asserts that a string ends with a given prefix.
 
1352
 *
 
1353
 * @param  string $suffix
 
1354
 * @param  string $string
 
1355
 * @param  string $message
 
1356
 * @since  Method available since Release 3.4.0
 
1357
 */
 
1358
function assertStringEndsWith($suffix, $string, $message = '')
 
1359
{
 
1360
    return call_user_func_array(
 
1361
        'PHPUnit_Framework_Assert::assertStringEndsWith',
 
1362
        func_get_args()
 
1363
    );
 
1364
}
 
1365
 
 
1366
/**
 
1367
 * Asserts that the contents of a string is equal
 
1368
 * to the contents of a file.
 
1369
 *
 
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
 
1376
 */
 
1377
function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
 
1378
{
 
1379
    return call_user_func_array(
 
1380
        'PHPUnit_Framework_Assert::assertStringEqualsFile',
 
1381
        func_get_args()
 
1382
    );
 
1383
}
 
1384
 
 
1385
/**
 
1386
 * Asserts that a string matches a given format string.
 
1387
 *
 
1388
 * @param  string $format
 
1389
 * @param  string $string
 
1390
 * @param  string $message
 
1391
 * @since  Method available since Release 3.5.0
 
1392
 */
 
1393
function assertStringMatchesFormat($format, $string, $message = '')
 
1394
{
 
1395
    return call_user_func_array(
 
1396
        'PHPUnit_Framework_Assert::assertStringMatchesFormat',
 
1397
        func_get_args()
 
1398
    );
 
1399
}
 
1400
 
 
1401
/**
 
1402
 * Asserts that a string matches a given format file.
 
1403
 *
 
1404
 * @param  string $formatFile
 
1405
 * @param  string $string
 
1406
 * @param  string $message
 
1407
 * @since  Method available since Release 3.5.0
 
1408
 */
 
1409
function assertStringMatchesFormatFile($formatFile, $string, $message = '')
 
1410
{
 
1411
    return call_user_func_array(
 
1412
        'PHPUnit_Framework_Assert::assertStringMatchesFormatFile',
 
1413
        func_get_args()
 
1414
    );
 
1415
}
 
1416
 
 
1417
/**
 
1418
 * Asserts that the contents of a string is not equal
 
1419
 * to the contents of a file.
 
1420
 *
 
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
 
1427
 */
 
1428
function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
 
1429
{
 
1430
    return call_user_func_array(
 
1431
        'PHPUnit_Framework_Assert::assertStringNotEqualsFile',
 
1432
        func_get_args()
 
1433
    );
 
1434
}
 
1435
 
 
1436
/**
 
1437
 * Asserts that a string does not match a given format string.
 
1438
 *
 
1439
 * @param  string $format
 
1440
 * @param  string $string
 
1441
 * @param  string $message
 
1442
 * @since  Method available since Release 3.5.0
 
1443
 */
 
1444
function assertStringNotMatchesFormat($format, $string, $message = '')
 
1445
{
 
1446
    return call_user_func_array(
 
1447
        'PHPUnit_Framework_Assert::assertStringNotMatchesFormat',
 
1448
        func_get_args()
 
1449
    );
 
1450
}
 
1451
 
 
1452
/**
 
1453
 * Asserts that a string does not match a given format string.
 
1454
 *
 
1455
 * @param  string $formatFile
 
1456
 * @param  string $string
 
1457
 * @param  string $message
 
1458
 * @since  Method available since Release 3.5.0
 
1459
 */
 
1460
function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
 
1461
{
 
1462
    return call_user_func_array(
 
1463
        'PHPUnit_Framework_Assert::assertStringNotMatchesFormatFile',
 
1464
        func_get_args()
 
1465
    );
 
1466
}
 
1467
 
 
1468
/**
 
1469
 * Asserts that a string starts not with a given prefix.
 
1470
 *
 
1471
 * @param  string $prefix
 
1472
 * @param  string $string
 
1473
 * @param  string $message
 
1474
 * @since  Method available since Release 3.4.0
 
1475
 */
 
1476
function assertStringStartsNotWith($prefix, $string, $message = '')
 
1477
{
 
1478
    return call_user_func_array(
 
1479
        'PHPUnit_Framework_Assert::assertStringStartsNotWith',
 
1480
        func_get_args()
 
1481
    );
 
1482
}
 
1483
 
 
1484
/**
 
1485
 * Asserts that a string starts with a given prefix.
 
1486
 *
 
1487
 * @param  string $prefix
 
1488
 * @param  string $string
 
1489
 * @param  string $message
 
1490
 * @since  Method available since Release 3.4.0
 
1491
 */
 
1492
function assertStringStartsWith($prefix, $string, $message = '')
 
1493
{
 
1494
    return call_user_func_array(
 
1495
        'PHPUnit_Framework_Assert::assertStringStartsWith',
 
1496
        func_get_args()
 
1497
    );
 
1498
}
 
1499
 
 
1500
/**
 
1501
 * Evaluate an HTML or XML string and assert its structure and/or contents.
 
1502
 *
 
1503
 * The first argument ($matcher) is an associative array that specifies the
 
1504
 * match criteria for the assertion:
 
1505
 *
 
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.
 
1521
 * Accepts the keys:
 
1522
 *- `count`: a number which must equal the number of children
 
1523
 *   that match
 
1524
 *- `less_than`: the number of matching children must be greater
 
1525
 *   than this number
 
1526
 *- `greater_than` : the number of matching children must be less than
 
1527
 *   this number
 
1528
 *- `only` : another hash consisting of the keys to use to match
 
1529
 *   on the children, and only matching children will be
 
1530
 *   counted
 
1531
 *
 
1532
 * <code>
 
1533
 * // Matcher that asserts that there is an element with an id="my_id".
 
1534
 * $matcher = array('id' => 'my_id');
 
1535
 *
 
1536
 * // Matcher that asserts that there is a "span" tag.
 
1537
 * $matcher = array('tag' => 'span');
 
1538
 *
 
1539
 * // Matcher that asserts that there is a "span" tag with the content
 
1540
 * // "Hello World".
 
1541
 * $matcher = array('tag' => 'span', 'content' => 'Hello World');
 
1542
 *
 
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)/');
 
1546
 *
 
1547
 * // Matcher that asserts that there is a "span" with an "list" class
 
1548
 * // attribute.
 
1549
 * $matcher = array(
 
1550
 *   'tag'=> 'span',
 
1551
 *   'attributes' => array('class' => 'list')
 
1552
 * );
 
1553
 *
 
1554
 * // Matcher that asserts that there is a "span" inside of a "div".
 
1555
 * $matcher = array(
 
1556
 *   'tag'=> 'span',
 
1557
 *   'parent' => array('tag' => 'div')
 
1558
 * );
 
1559
 *
 
1560
 * // Matcher that asserts that there is a "span" somewhere inside a
 
1561
 * // "table".
 
1562
 * $matcher = array(
 
1563
 *   'tag'  => 'span',
 
1564
 *   'ancestor' => array('tag' => 'table')
 
1565
 * );
 
1566
 *
 
1567
 * // Matcher that asserts that there is a "span" with at least one "em"
 
1568
 * // child.
 
1569
 * $matcher = array(
 
1570
 *   'tag'   => 'span',
 
1571
 *   'child' => array('tag' => 'em')
 
1572
 * );
 
1573
 *
 
1574
 * // Matcher that asserts that there is a "span" containing a (possibly
 
1575
 * // nested) "strong" tag.
 
1576
 * $matcher = array(
 
1577
 *   'tag'=> 'span',
 
1578
 *   'descendant' => array('tag' => 'strong')
 
1579
 * );
 
1580
 *
 
1581
 * // Matcher that asserts that there is a "span" containing 5-10 "em" tags
 
1582
 * // as immediate children.
 
1583
 * $matcher = array(
 
1584
 *   'tag'  => 'span',
 
1585
 *   'children' => array(
 
1586
 * 'less_than'=> 11,
 
1587
 * 'greater_than' => 4,
 
1588
 * 'only' => array('tag' => 'em')
 
1589
 *   )
 
1590
 * );
 
1591
 *
 
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".
 
1595
 * $matcher = array(
 
1596
 *   'tag'=> 'div',
 
1597
 *   'ancestor'   => array('tag' => 'ul'),
 
1598
 *   'parent' => array(
 
1599
 * 'tag'=> 'li',
 
1600
 * 'attributes' => array('class' => 'enum')
 
1601
 *   ),
 
1602
 *   'descendant' => array(
 
1603
 * 'tag'   => 'span',
 
1604
 * 'child' => array(
 
1605
 *   'id'  => 'my_test',
 
1606
 *   'content' => 'Hello World'
 
1607
 * )
 
1608
 *   )
 
1609
 * );
 
1610
 *
 
1611
 * // Use assertTag() to apply a $matcher to a piece of $html.
 
1612
 * $this->assertTag($matcher, $html);
 
1613
 *
 
1614
 * // Use assertTag() to apply a $matcher to a piece of $xml.
 
1615
 * $this->assertTag($matcher, $xml, '', false);
 
1616
 * </code>
 
1617
 *
 
1618
 * The second argument ($actual) is a string containing either HTML or
 
1619
 * XML text to be tested.
 
1620
 *
 
1621
 * The third argument ($message) is an optional message that will be
 
1622
 * used if the assertion fails.
 
1623
 *
 
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.
 
1628
 *
 
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>
 
1636
 */
 
1637
function assertTag($matcher, $actual, $message = '', $isHtml = true)
 
1638
{
 
1639
    return call_user_func_array(
 
1640
        'PHPUnit_Framework_Assert::assertTag',
 
1641
        func_get_args()
 
1642
    );
 
1643
}
 
1644
 
 
1645
/**
 
1646
 * Evaluates a PHPUnit_Framework_Constraint matcher object.
 
1647
 *
 
1648
 * @param  mixed$value
 
1649
 * @param  PHPUnit_Framework_Constraint $constraint
 
1650
 * @param  string   $message
 
1651
 * @since  Method available since Release 3.0.0
 
1652
 */
 
1653
function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
 
1654
{
 
1655
    return call_user_func_array(
 
1656
        'PHPUnit_Framework_Assert::assertThat',
 
1657
        func_get_args()
 
1658
    );
 
1659
}
 
1660
 
 
1661
/**
 
1662
 * Asserts that a condition is true.
 
1663
 *
 
1664
 * @param  boolean $condition
 
1665
 * @param  string  $message
 
1666
 * @throws PHPUnit_Framework_AssertionFailedError
 
1667
 */
 
1668
function assertTrue($condition, $message = '')
 
1669
{
 
1670
    return call_user_func_array(
 
1671
        'PHPUnit_Framework_Assert::assertTrue',
 
1672
        func_get_args()
 
1673
    );
 
1674
}
 
1675
 
 
1676
/**
 
1677
 * Asserts that two XML files are equal.
 
1678
 *
 
1679
 * @param  string $expectedFile
 
1680
 * @param  string $actualFile
 
1681
 * @param  string $message
 
1682
 * @since  Method available since Release 3.1.0
 
1683
 */
 
1684
function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
 
1685
{
 
1686
    return call_user_func_array(
 
1687
        'PHPUnit_Framework_Assert::assertXmlFileEqualsXmlFile',
 
1688
        func_get_args()
 
1689
    );
 
1690
}
 
1691
 
 
1692
/**
 
1693
 * Asserts that two XML files are not equal.
 
1694
 *
 
1695
 * @param  string $expectedFile
 
1696
 * @param  string $actualFile
 
1697
 * @param  string $message
 
1698
 * @since  Method available since Release 3.1.0
 
1699
 */
 
1700
function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
 
1701
{
 
1702
    return call_user_func_array(
 
1703
        'PHPUnit_Framework_Assert::assertXmlFileNotEqualsXmlFile',
 
1704
        func_get_args()
 
1705
    );
 
1706
}
 
1707
 
 
1708
/**
 
1709
 * Asserts that two XML documents are equal.
 
1710
 *
 
1711
 * @param  string $expectedFile
 
1712
 * @param  string $actualXml
 
1713
 * @param  string $message
 
1714
 * @since  Method available since Release 3.3.0
 
1715
 */
 
1716
function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
 
1717
{
 
1718
    return call_user_func_array(
 
1719
        'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile',
 
1720
        func_get_args()
 
1721
    );
 
1722
}
 
1723
 
 
1724
/**
 
1725
 * Asserts that two XML documents are equal.
 
1726
 *
 
1727
 * @param  string $expectedXml
 
1728
 * @param  string $actualXml
 
1729
 * @param  string $message
 
1730
 * @since  Method available since Release 3.1.0
 
1731
 */
 
1732
function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
 
1733
{
 
1734
    return call_user_func_array(
 
1735
        'PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString',
 
1736
        func_get_args()
 
1737
    );
 
1738
}
 
1739
 
 
1740
/**
 
1741
 * Asserts that two XML documents are not equal.
 
1742
 *
 
1743
 * @param  string $expectedFile
 
1744
 * @param  string $actualXml
 
1745
 * @param  string $message
 
1746
 * @since  Method available since Release 3.3.0
 
1747
 */
 
1748
function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
 
1749
{
 
1750
    return call_user_func_array(
 
1751
        'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlFile',
 
1752
        func_get_args()
 
1753
    );
 
1754
}
 
1755
 
 
1756
/**
 
1757
 * Asserts that two XML documents are not equal.
 
1758
 *
 
1759
 * @param  string $expectedXml
 
1760
 * @param  string $actualXml
 
1761
 * @param  string $message
 
1762
 * @since  Method available since Release 3.1.0
 
1763
 */
 
1764
function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
 
1765
{
 
1766
    return call_user_func_array(
 
1767
        'PHPUnit_Framework_Assert::assertXmlStringNotEqualsXmlString',
 
1768
        func_get_args()
 
1769
    );
 
1770
}
 
1771
 
 
1772
/**
 
1773
 * Returns a matcher that matches when the method it is evaluated for
 
1774
 * is invoked at the given $index.
 
1775
 *
 
1776
 * @param  integer $index
 
1777
 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
 
1778
 * @since  Method available since Release 3.0.0
 
1779
 */
 
1780
function at($index)
 
1781
{
 
1782
    return call_user_func_array(
 
1783
        'PHPUnit_Framework_TestCase::at',
 
1784
        func_get_args()
 
1785
    );
 
1786
}
 
1787
 
 
1788
/**
 
1789
 * Returns a matcher that matches when the method it is evaluated for
 
1790
 * is executed at least once.
 
1791
 *
 
1792
 * @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
 
1793
 * @since  Method available since Release 3.0.0
 
1794
 */
 
1795
function atLeastOnce()
 
1796
{
 
1797
    return call_user_func_array(
 
1798
        'PHPUnit_Framework_TestCase::atLeastOnce',
 
1799
        func_get_args()
 
1800
    );
 
1801
}
 
1802
 
 
1803
/**
 
1804
 * Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
 
1805
 *
 
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
 
1810
 */
 
1811
function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
 
1812
{
 
1813
    return call_user_func_array(
 
1814
        'PHPUnit_Framework_Assert::attribute',
 
1815
        func_get_args()
 
1816
    );
 
1817
}
 
1818
 
 
1819
/**
 
1820
 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object
 
1821
 * that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
 
1822
 * object.
 
1823
 *
 
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
 
1832
 */
 
1833
function attributeEqualTo($attributeName, $value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
1834
{
 
1835
    return call_user_func_array(
 
1836
        'PHPUnit_Framework_Assert::attributeEqualTo',
 
1837
        func_get_args()
 
1838
    );
 
1839
}
 
1840
 
 
1841
/**
 
1842
 * Returns a PHPUnit_Framework_Constraint_Callback matcher object.
 
1843
 *
 
1844
 * @param callable $callback
 
1845
 * @return PHPUnit_Framework_Constraint_Callback
 
1846
 */
 
1847
function callback($callback)
 
1848
{
 
1849
    return call_user_func_array(
 
1850
        'PHPUnit_Framework_Assert::callback',
 
1851
        func_get_args()
 
1852
    );
 
1853
}
 
1854
 
 
1855
/**
 
1856
 * Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
 
1857
 *
 
1858
 * @param  string $attributeName
 
1859
 * @return PHPUnit_Framework_Constraint_ClassHasAttribute
 
1860
 * @since  Method available since Release 3.1.0
 
1861
 */
 
1862
function classHasAttribute($attributeName)
 
1863
{
 
1864
    return call_user_func_array(
 
1865
        'PHPUnit_Framework_Assert::classHasAttribute',
 
1866
        func_get_args()
 
1867
    );
 
1868
}
 
1869
 
 
1870
/**
 
1871
 * Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
 
1872
 * object.
 
1873
 *
 
1874
 * @param  string $attributeName
 
1875
 * @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
 
1876
 * @since  Method available since Release 3.1.0
 
1877
 */
 
1878
function classHasStaticAttribute($attributeName)
 
1879
{
 
1880
    return call_user_func_array(
 
1881
        'PHPUnit_Framework_Assert::classHasStaticAttribute',
 
1882
        func_get_args()
 
1883
    );
 
1884
}
 
1885
 
 
1886
/**
 
1887
 * Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
 
1888
 * object.
 
1889
 *
 
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
 
1895
 */
 
1896
function contains($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 
1897
{
 
1898
    return call_user_func_array(
 
1899
        'PHPUnit_Framework_Assert::contains',
 
1900
        func_get_args()
 
1901
    );
 
1902
}
 
1903
 
 
1904
/**
 
1905
 * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
 
1906
 * object.
 
1907
 *
 
1908
 * @param  string $type
 
1909
 * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
 
1910
 * @since  Method available since Release 3.1.4
 
1911
 */
 
1912
function containsOnly($type)
 
1913
{
 
1914
    return call_user_func_array(
 
1915
        'PHPUnit_Framework_Assert::containsOnly',
 
1916
        func_get_args()
 
1917
    );
 
1918
}
 
1919
 
 
1920
/**
 
1921
 * Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
 
1922
 * object.
 
1923
 *
 
1924
 * @param string $classname
 
1925
 * @return PHPUnit_Framework_Constraint_TraversableContainsOnly
 
1926
 */
 
1927
function containsOnlyInstancesOf($classname)
 
1928
{
 
1929
    return call_user_func_array(
 
1930
        'PHPUnit_Framework_Assert::containsOnlyInstancesOf',
 
1931
        func_get_args()
 
1932
    );
 
1933
}
 
1934
 
 
1935
/**
 
1936
 * Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
 
1937
 *
 
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
 
1945
 */
 
1946
function equalTo($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 
1947
{
 
1948
    return call_user_func_array(
 
1949
        'PHPUnit_Framework_Assert::equalTo',
 
1950
        func_get_args()
 
1951
    );
 
1952
}
 
1953
 
 
1954
/**
 
1955
 * Returns a matcher that matches when the method it is evaluated for
 
1956
 * is executed exactly $count times.
 
1957
 *
 
1958
 * @param  integer $count
 
1959
 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
 
1960
 * @since  Method available since Release 3.0.0
 
1961
 */
 
1962
function exactly($count)
 
1963
{
 
1964
    return call_user_func_array(
 
1965
        'PHPUnit_Framework_TestCase::exactly',
 
1966
        func_get_args()
 
1967
    );
 
1968
}
 
1969
 
 
1970
/**
 
1971
 * Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
 
1972
 *
 
1973
 * @return PHPUnit_Framework_Constraint_FileExists
 
1974
 * @since  Method available since Release 3.0.0
 
1975
 */
 
1976
function fileExists()
 
1977
{
 
1978
    return call_user_func_array(
 
1979
        'PHPUnit_Framework_Assert::fileExists',
 
1980
        func_get_args()
 
1981
    );
 
1982
}
 
1983
 
 
1984
/**
 
1985
 * Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
 
1986
 *
 
1987
 * @param  mixed $value
 
1988
 * @return PHPUnit_Framework_Constraint_GreaterThan
 
1989
 * @since  Method available since Release 3.0.0
 
1990
 */
 
1991
function greaterThan($value)
 
1992
{
 
1993
    return call_user_func_array(
 
1994
        'PHPUnit_Framework_Assert::greaterThan',
 
1995
        func_get_args()
 
1996
    );
 
1997
}
 
1998
 
 
1999
/**
 
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.
 
2003
 *
 
2004
 * @param  mixed $value
 
2005
 * @return PHPUnit_Framework_Constraint_Or
 
2006
 * @since  Method available since Release 3.1.0
 
2007
 */
 
2008
function greaterThanOrEqual($value)
 
2009
{
 
2010
    return call_user_func_array(
 
2011
        'PHPUnit_Framework_Assert::greaterThanOrEqual',
 
2012
        func_get_args()
 
2013
    );
 
2014
}
 
2015
 
 
2016
/**
 
2017
 * Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
 
2018
 *
 
2019
 * @param  mixed $value
 
2020
 * @return PHPUnit_Framework_Constraint_IsIdentical
 
2021
 * @since  Method available since Release 3.0.0
 
2022
 */
 
2023
function identicalTo($value)
 
2024
{
 
2025
    return call_user_func_array(
 
2026
        'PHPUnit_Framework_Assert::identicalTo',
 
2027
        func_get_args()
 
2028
    );
 
2029
}
 
2030
 
 
2031
/**
 
2032
 * Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
 
2033
 *
 
2034
 * @return PHPUnit_Framework_Constraint_IsEmpty
 
2035
 * @since  Method available since Release 3.5.0
 
2036
 */
 
2037
function isEmpty()
 
2038
{
 
2039
    return call_user_func_array(
 
2040
        'PHPUnit_Framework_Assert::isEmpty',
 
2041
        func_get_args()
 
2042
    );
 
2043
}
 
2044
 
 
2045
/**
 
2046
 * Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
 
2047
 *
 
2048
 * @return PHPUnit_Framework_Constraint_IsFalse
 
2049
 * @since  Method available since Release 3.3.0
 
2050
 */
 
2051
function isFalse()
 
2052
{
 
2053
    return call_user_func_array(
 
2054
        'PHPUnit_Framework_Assert::isFalse',
 
2055
        func_get_args()
 
2056
    );
 
2057
}
 
2058
 
 
2059
/**
 
2060
 * Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
 
2061
 *
 
2062
 * @param  string $className
 
2063
 * @return PHPUnit_Framework_Constraint_IsInstanceOf
 
2064
 * @since  Method available since Release 3.0.0
 
2065
 */
 
2066
function isInstanceOf($className)
 
2067
{
 
2068
    return call_user_func_array(
 
2069
        'PHPUnit_Framework_Assert::isInstanceOf',
 
2070
        func_get_args()
 
2071
    );
 
2072
}
 
2073
 
 
2074
/**
 
2075
 * Returns a PHPUnit_Framework_Constraint_IsJson matcher object.
 
2076
 *
 
2077
 * @return PHPUnit_Framework_Constraint_IsJson
 
2078
 * @since  Method available since Release 3.7.20
 
2079
 */
 
2080
function isJson()
 
2081
{
 
2082
    return call_user_func_array(
 
2083
        'PHPUnit_Framework_Assert::isJson',
 
2084
        func_get_args()
 
2085
    );
 
2086
}
 
2087
 
 
2088
/**
 
2089
 * Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
 
2090
 *
 
2091
 * @return PHPUnit_Framework_Constraint_IsNull
 
2092
 * @since  Method available since Release 3.3.0
 
2093
 */
 
2094
function isNull()
 
2095
{
 
2096
    return call_user_func_array(
 
2097
        'PHPUnit_Framework_Assert::isNull',
 
2098
        func_get_args()
 
2099
    );
 
2100
}
 
2101
 
 
2102
/**
 
2103
 * Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
 
2104
 *
 
2105
 * @return PHPUnit_Framework_Constraint_IsTrue
 
2106
 * @since  Method available since Release 3.3.0
 
2107
 */
 
2108
function isTrue()
 
2109
{
 
2110
    return call_user_func_array(
 
2111
        'PHPUnit_Framework_Assert::isTrue',
 
2112
        func_get_args()
 
2113
    );
 
2114
}
 
2115
 
 
2116
/**
 
2117
 * Returns a PHPUnit_Framework_Constraint_IsType matcher object.
 
2118
 *
 
2119
 * @param  string $type
 
2120
 * @return PHPUnit_Framework_Constraint_IsType
 
2121
 * @since  Method available since Release 3.0.0
 
2122
 */
 
2123
function isType($type)
 
2124
{
 
2125
    return call_user_func_array(
 
2126
        'PHPUnit_Framework_Assert::isType',
 
2127
        func_get_args()
 
2128
    );
 
2129
}
 
2130
 
 
2131
/**
 
2132
 * Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
 
2133
 *
 
2134
 * @param  mixed $value
 
2135
 * @return PHPUnit_Framework_Constraint_LessThan
 
2136
 * @since  Method available since Release 3.0.0
 
2137
 */
 
2138
function lessThan($value)
 
2139
{
 
2140
    return call_user_func_array(
 
2141
        'PHPUnit_Framework_Assert::lessThan',
 
2142
        func_get_args()
 
2143
    );
 
2144
}
 
2145
 
 
2146
/**
 
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.
 
2150
 *
 
2151
 * @param  mixed $value
 
2152
 * @return PHPUnit_Framework_Constraint_Or
 
2153
 * @since  Method available since Release 3.1.0
 
2154
 */
 
2155
function lessThanOrEqual($value)
 
2156
{
 
2157
    return call_user_func_array(
 
2158
        'PHPUnit_Framework_Assert::lessThanOrEqual',
 
2159
        func_get_args()
 
2160
    );
 
2161
}
 
2162
 
 
2163
/**
 
2164
 * Returns a PHPUnit_Framework_Constraint_And matcher object.
 
2165
 *
 
2166
 * @return PHPUnit_Framework_Constraint_And
 
2167
 * @since  Method available since Release 3.0.0
 
2168
 */
 
2169
function logicalAnd()
 
2170
{
 
2171
    return call_user_func_array(
 
2172
        'PHPUnit_Framework_Assert::logicalAnd',
 
2173
        func_get_args()
 
2174
    );
 
2175
}
 
2176
 
 
2177
/**
 
2178
 * Returns a PHPUnit_Framework_Constraint_Not matcher object.
 
2179
 *
 
2180
 * @param  PHPUnit_Framework_Constraint $constraint
 
2181
 * @return PHPUnit_Framework_Constraint_Not
 
2182
 * @since  Method available since Release 3.0.0
 
2183
 */
 
2184
function logicalNot(PHPUnit_Framework_Constraint $constraint)
 
2185
{
 
2186
    return call_user_func_array(
 
2187
        'PHPUnit_Framework_Assert::logicalNot',
 
2188
        func_get_args()
 
2189
    );
 
2190
}
 
2191
 
 
2192
/**
 
2193
 * Returns a PHPUnit_Framework_Constraint_Or matcher object.
 
2194
 *
 
2195
 * @return PHPUnit_Framework_Constraint_Or
 
2196
 * @since  Method available since Release 3.0.0
 
2197
 */
 
2198
function logicalOr()
 
2199
{
 
2200
    return call_user_func_array(
 
2201
        'PHPUnit_Framework_Assert::logicalOr',
 
2202
        func_get_args()
 
2203
    );
 
2204
}
 
2205
 
 
2206
/**
 
2207
 * Returns a PHPUnit_Framework_Constraint_Xor matcher object.
 
2208
 *
 
2209
 * @return PHPUnit_Framework_Constraint_Xor
 
2210
 * @since  Method available since Release 3.0.0
 
2211
 */
 
2212
function logicalXor()
 
2213
{
 
2214
    return call_user_func_array(
 
2215
        'PHPUnit_Framework_Assert::logicalXor',
 
2216
        func_get_args()
 
2217
    );
 
2218
}
 
2219
 
 
2220
/**
 
2221
 * Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
 
2222
 *
 
2223
 * @param  string $string
 
2224
 * @return PHPUnit_Framework_Constraint_StringMatches
 
2225
 * @since  Method available since Release 3.5.0
 
2226
 */
 
2227
function matches($string)
 
2228
{
 
2229
    return call_user_func_array(
 
2230
        'PHPUnit_Framework_Assert::matches',
 
2231
        func_get_args()
 
2232
    );
 
2233
}
 
2234
 
 
2235
/**
 
2236
 * Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
 
2237
 *
 
2238
 * @param  string $pattern
 
2239
 * @return PHPUnit_Framework_Constraint_PCREMatch
 
2240
 * @since  Method available since Release 3.0.0
 
2241
 */
 
2242
function matchesRegularExpression($pattern)
 
2243
{
 
2244
    return call_user_func_array(
 
2245
        'PHPUnit_Framework_Assert::matchesRegularExpression',
 
2246
        func_get_args()
 
2247
    );
 
2248
}
 
2249
 
 
2250
/**
 
2251
 * Returns a matcher that matches when the method it is evaluated for
 
2252
 * is never executed.
 
2253
 *
 
2254
 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
 
2255
 * @since  Method available since Release 3.0.0
 
2256
 */
 
2257
function never()
 
2258
{
 
2259
    return call_user_func_array(
 
2260
        'PHPUnit_Framework_TestCase::never',
 
2261
        func_get_args()
 
2262
    );
 
2263
}
 
2264
 
 
2265
/**
 
2266
 * Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
 
2267
 *
 
2268
 * @param  string $attributeName
 
2269
 * @return PHPUnit_Framework_Constraint_ObjectHasAttribute
 
2270
 * @since  Method available since Release 3.0.0
 
2271
 */
 
2272
function objectHasAttribute($attributeName)
 
2273
{
 
2274
    return call_user_func_array(
 
2275
        'PHPUnit_Framework_Assert::objectHasAttribute',
 
2276
        func_get_args()
 
2277
    );
 
2278
}
 
2279
 
 
2280
/**
 
2281
 * @param  mixed $value, ...
 
2282
 * @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
 
2283
 * @since  Method available since Release 3.0.0
 
2284
 */
 
2285
function onConsecutiveCalls()
 
2286
{
 
2287
    return call_user_func_array(
 
2288
        'PHPUnit_Framework_TestCase::onConsecutiveCalls',
 
2289
        func_get_args()
 
2290
    );
 
2291
}
 
2292
 
 
2293
/**
 
2294
 * Returns a matcher that matches when the method it is evaluated for
 
2295
 * is executed exactly once.
 
2296
 *
 
2297
 * @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
 
2298
 * @since  Method available since Release 3.0.0
 
2299
 */
 
2300
function once()
 
2301
{
 
2302
    return call_user_func_array(
 
2303
        'PHPUnit_Framework_TestCase::once',
 
2304
        func_get_args()
 
2305
    );
 
2306
}
 
2307
 
 
2308
/**
 
2309
 *
 
2310
 *
 
2311
 * @param  integer $argumentIndex
 
2312
 * @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
 
2313
 * @since  Method available since Release 3.3.0
 
2314
 */
 
2315
function returnArgument($argumentIndex)
 
2316
{
 
2317
    return call_user_func_array(
 
2318
        'PHPUnit_Framework_TestCase::returnArgument',
 
2319
        func_get_args()
 
2320
    );
 
2321
}
 
2322
 
 
2323
/**
 
2324
 *
 
2325
 *
 
2326
 * @param  mixed $callback
 
2327
 * @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
 
2328
 * @since  Method available since Release 3.3.0
 
2329
 */
 
2330
function returnCallback($callback)
 
2331
{
 
2332
    return call_user_func_array(
 
2333
        'PHPUnit_Framework_TestCase::returnCallback',
 
2334
        func_get_args()
 
2335
    );
 
2336
}
 
2337
 
 
2338
/**
 
2339
 * Returns the current object.
 
2340
 *
 
2341
 * This method is useful when mocking a fluent interface.
 
2342
 *
 
2343
 * @return PHPUnit_Framework_MockObject_Stub_ReturnSelf
 
2344
 * @since  Method available since Release 3.6.0
 
2345
 */
 
2346
function returnSelf()
 
2347
{
 
2348
    return call_user_func_array(
 
2349
        'PHPUnit_Framework_TestCase::returnSelf',
 
2350
        func_get_args()
 
2351
    );
 
2352
}
 
2353
 
 
2354
/**
 
2355
 *
 
2356
 *
 
2357
 * @param  mixed $value
 
2358
 * @return PHPUnit_Framework_MockObject_Stub_Return
 
2359
 * @since  Method available since Release 3.0.0
 
2360
 */
 
2361
function returnValue($value)
 
2362
{
 
2363
    return call_user_func_array(
 
2364
        'PHPUnit_Framework_TestCase::returnValue',
 
2365
        func_get_args()
 
2366
    );
 
2367
}
 
2368
 
 
2369
/**
 
2370
 *
 
2371
 *
 
2372
 * @param  array $valueMap
 
2373
 * @return PHPUnit_Framework_MockObject_Stub_ReturnValueMap
 
2374
 * @since  Method available since Release 3.6.0
 
2375
 */
 
2376
function returnValueMap(array $valueMap)
 
2377
{
 
2378
    return call_user_func_array(
 
2379
        'PHPUnit_Framework_TestCase::returnValueMap',
 
2380
        func_get_args()
 
2381
    );
 
2382
}
 
2383
 
 
2384
/**
 
2385
 * Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
 
2386
 *
 
2387
 * @param  string  $string
 
2388
 * @param  boolean $case
 
2389
 * @return PHPUnit_Framework_Constraint_StringContains
 
2390
 * @since  Method available since Release 3.0.0
 
2391
 */
 
2392
function stringContains($string, $case = true)
 
2393
{
 
2394
    return call_user_func_array(
 
2395
        'PHPUnit_Framework_Assert::stringContains',
 
2396
        func_get_args()
 
2397
    );
 
2398
}
 
2399
 
 
2400
/**
 
2401
 * Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
 
2402
 *
 
2403
 * @param  mixed $suffix
 
2404
 * @return PHPUnit_Framework_Constraint_StringEndsWith
 
2405
 * @since  Method available since Release 3.4.0
 
2406
 */
 
2407
function stringEndsWith($suffix)
 
2408
{
 
2409
    return call_user_func_array(
 
2410
        'PHPUnit_Framework_Assert::stringEndsWith',
 
2411
        func_get_args()
 
2412
    );
 
2413
}
 
2414
 
 
2415
/**
 
2416
 * Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
 
2417
 *
 
2418
 * @param  mixed $prefix
 
2419
 * @return PHPUnit_Framework_Constraint_StringStartsWith
 
2420
 * @since  Method available since Release 3.4.0
 
2421
 */
 
2422
function stringStartsWith($prefix)
 
2423
{
 
2424
    return call_user_func_array(
 
2425
        'PHPUnit_Framework_Assert::stringStartsWith',
 
2426
        func_get_args()
 
2427
    );
 
2428
}
 
2429
 
 
2430
/**
 
2431
 *
 
2432
 *
 
2433
 * @param  Exception $exception
 
2434
 * @return PHPUnit_Framework_MockObject_Stub_Exception
 
2435
 * @since  Method available since Release 3.1.0
 
2436
 */
 
2437
function throwException(Exception $exception)
 
2438
{
 
2439
    return call_user_func_array(
 
2440
        'PHPUnit_Framework_TestCase::throwException',
 
2441
        func_get_args()
 
2442
    );
 
2443
}