-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress-tests-stubs.php
3298 lines (3297 loc) · 91.8 KB
/
wordpress-tests-stubs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Generated stub declarations for WordPress Tests.
* @see https://wordpress.org
* @see https://github.com/php-stubs/wordpress-tests-stubs
*/
/**
* PHPUnit adapter layer.
*
* This class enhances the PHPUnit native `TestCase` with polyfills
* for assertions and expectation methods added between PHPUnit 4.8 - 9.6.
*
* Additionally, the Polyfill TestCase offers a workaround for the addition
* of the `void` return type to PHPUnit fixture methods by providing
* overloadable snake_case versions of the typical fixture method names and
* ensuring that PHPUnit handles those correctly.
*
* See {@link https://github.com/Yoast/PHPUnit-Polyfills} for full
* documentation on the available polyfills and other features.
*/
abstract class PHPUnit_Adapter_TestCase extends \Yoast\PHPUnitPolyfills\TestCases\TestCase
{
}
/**
* Defines a basic fixture to run multiple tests.
*
* Resets the state of the WordPress installation before and after every test.
*
* Includes utility functions and assertions useful for testing WordPress.
*
* All WordPress unit tests should inherit from this class.
*/
abstract class WP_UnitTestCase_Base extends \PHPUnit_Adapter_TestCase
{
protected static $forced_tickets = array();
protected $expected_deprecated = array();
protected $caught_deprecated = array();
protected $expected_doing_it_wrong = array();
protected $caught_doing_it_wrong = array();
protected static $hooks_saved = array();
protected static $ignore_files;
/**
* Fixture factory.
*
* @deprecated 6.1.0 Use the WP_UnitTestCase_Base::factory() method instead.
*
* @var WP_UnitTest_Factory
*/
protected $factory;
/**
* Fetches the factory object for generating WordPress fixtures.
*
* @return WP_UnitTest_Factory The fixture factory.
*/
protected static function factory()
{
}
/**
* Retrieves the name of the class the static method is called in.
*
* @deprecated 5.3.0 Use the PHP native get_called_class() function instead.
*
* @return string The class name.
*/
public static function get_called_class()
{
}
/**
* Runs the routine before setting up all tests.
*/
public static function set_up_before_class()
{
}
/**
* Runs the routine after all tests have been run.
*/
public static function tear_down_after_class()
{
}
/**
* Runs the routine before each test is executed.
*/
public function set_up()
{
}
/**
* After a test method runs, resets any state in WordPress the test method might have changed.
*/
public function tear_down()
{
}
/**
* Cleans the global scope (e.g `$_GET` and `$_POST`).
*/
public function clean_up_global_scope()
{
}
/**
* Allows tests to be skipped on some automated runs.
*
* For test runs on GitHub Actions for something other than trunk,
* we want to skip tests that only need to run for trunk.
*/
public function skipOnAutomatedBranches()
{
}
/**
* Allows tests to be skipped when Multisite is not in use.
*
* Use in conjunction with the ms-required group.
*/
public function skipWithoutMultisite()
{
}
/**
* Allows tests to be skipped when Multisite is in use.
*
* Use in conjunction with the ms-excluded group.
*/
public function skipWithMultisite()
{
}
/**
* Allows tests to be skipped if the HTTP request times out.
*
* @param array|WP_Error $response HTTP response.
*/
public function skipTestOnTimeout($response)
{
}
/**
* Reset the lazy load meta queue.
*/
protected function reset_lazyload_queue()
{
}
/**
* Unregisters existing post types and register defaults.
*
* Run before each test in order to clean up the global scope, in case
* a test forgets to unregister a post type on its own, or fails before
* it has a chance to do so.
*/
protected function reset_post_types()
{
}
/**
* Unregisters existing taxonomies and register defaults.
*
* Run before each test in order to clean up the global scope, in case
* a test forgets to unregister a taxonomy on its own, or fails before
* it has a chance to do so.
*/
protected function reset_taxonomies()
{
}
/**
* Unregisters non-built-in post statuses.
*/
protected function reset_post_statuses()
{
}
/**
* Resets `$_SERVER` variables
*/
protected function reset__SERVER()
{
}
/**
* Saves the hook-related globals so they can be restored later.
*
* Stores $wp_filter, $wp_actions, $wp_filters, and $wp_current_filter
* on a class variable so they can be restored on tear_down() using _restore_hooks().
*
* @global array $wp_filter
* @global array $wp_actions
* @global array $wp_filters
* @global array $wp_current_filter
*/
protected function _backup_hooks()
{
}
/**
* Restores the hook-related globals to their state at set_up()
* so that future tests aren't affected by hooks set during this last test.
*
* @global array $wp_filter
* @global array $wp_actions
* @global array $wp_filters
* @global array $wp_current_filter
*/
protected function _restore_hooks()
{
}
/**
* Flushes the WordPress object cache.
*/
public static function flush_cache()
{
}
/**
* Cleans up any registered meta keys.
*
* @since 5.1.0
*
* @global array $wp_meta_keys
*/
public function unregister_all_meta_keys()
{
}
/**
* Starts a database transaction.
*/
public function start_transaction()
{
}
/**
* Commits the queries in a transaction.
*
* @since 4.1.0
*/
public static function commit_transaction()
{
}
/**
* Replaces the `CREATE TABLE` statement with a `CREATE TEMPORARY TABLE` statement.
*
* @param string $query The query to replace the statement for.
* @return string The altered query.
*/
public function _create_temporary_tables($query)
{
}
/**
* Replaces the `DROP TABLE` statement with a `DROP TEMPORARY TABLE` statement.
*
* @param string $query The query to replace the statement for.
* @return string The altered query.
*/
public function _drop_temporary_tables($query)
{
}
/**
* Retrieves the `wp_die()` handler.
*
* @param callable $handler The current die handler.
* @return callable The test die handler.
*/
public function get_wp_die_handler($handler)
{
}
/**
* Throws an exception when called.
*
* @since UT (3.7.0)
* @since 5.9.0 Added the `$title` and `$args` parameters.
*
* @throws WPDieException Exception containing the message and the response code.
*
* @param string|WP_Error $message The `wp_die()` message or WP_Error object.
* @param string $title The `wp_die()` title.
* @param string|array $args The `wp_die()` arguments.
*/
public function wp_die_handler($message, $title, $args)
{
}
/**
* Sets up the expectations for testing a deprecated call.
*
* @since 3.7.0
*/
public function expectDeprecated()
{
}
/**
* Handles a deprecated expectation.
*
* The DocBlock should contain `@expectedDeprecated` to trigger this.
*
* @since 3.7.0
* @since 6.1.0 Includes the actual unexpected `_doing_it_wrong()` message
* or deprecation notice in the output if one is encountered.
*/
public function expectedDeprecated()
{
}
/**
* Detects post-test failure conditions.
*
* We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations.
*
* @since 4.2.0
*/
protected function assert_post_conditions()
{
}
/**
* Declares an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test.
*
* @since 4.2.0
*
* @param string $deprecated Name of the function, method, class, or argument that is deprecated.
* Must match the first parameter of the `_deprecated_function()`
* or `_deprecated_argument()` call.
*/
public function setExpectedDeprecated($deprecated)
{
}
/**
* Declares an expected `_doing_it_wrong()` call from within a test.
*
* @since 4.2.0
*
* @param string $doing_it_wrong Name of the function, method, or class that appears in
* the first argument of the source `_doing_it_wrong()` call.
*/
public function setExpectedIncorrectUsage($doing_it_wrong)
{
}
/**
* Redundant PHPUnit 6+ compatibility shim. DO NOT USE!
*
* This method is only left in place for backward compatibility reasons.
*
* @since 4.8.0
* @deprecated 5.9.0 Use the PHPUnit native expectException*() methods directly.
*
* @param mixed $exception
* @param string $message
* @param int|string $code
*/
public function setExpectedException($exception, $message = '', $code = \null)
{
}
/**
* Adds a deprecated function to the list of caught deprecated calls.
*
* @since 3.7.0
* @since 6.1.0 Added the `$replacement`, `$version`, and `$message` parameters.
*
* @param string $function_name The deprecated function.
* @param string $replacement The function that should have been called.
* @param string $version The version of WordPress that deprecated the function.
* @param string $message Optional. A message regarding the change.
*/
public function deprecated_function_run($function_name, $replacement, $version, $message = '')
{
}
/**
* Adds a function called in a wrong way to the list of `_doing_it_wrong()` calls.
*
* @since 3.7.0
* @since 6.1.0 Added the `$message` and `$version` parameters.
*
* @param string $function_name The function to add.
* @param string $message A message explaining what has been done incorrectly.
* @param string $version The version of WordPress where the message was added.
*/
public function doing_it_wrong_run($function_name, $message, $version)
{
}
/**
* Asserts that the given value is an instance of WP_Error.
*
* @param mixed $actual The value to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertWPError($actual, $message = '')
{
}
/**
* Asserts that the given value is not an instance of WP_Error.
*
* @param mixed $actual The value to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertNotWPError($actual, $message = '')
{
}
/**
* Asserts that the given value is an instance of IXR_Error.
*
* @param mixed $actual The value to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertIXRError($actual, $message = '')
{
}
/**
* Asserts that the given value is not an instance of IXR_Error.
*
* @param mixed $actual The value to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertNotIXRError($actual, $message = '')
{
}
/**
* Asserts that the given fields are present in the given object.
*
* @since UT (3.7.0)
* @since 5.9.0 Added the `$message` parameter.
*
* @param object $actual The object to check.
* @param array $fields The fields to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertEqualFields($actual, $fields, $message = '')
{
}
/**
* Asserts that two values are equal, with whitespace differences discarded.
*
* @since UT (3.7.0)
* @since 5.9.0 Added the `$message` parameter.
*
* @param mixed $expected The expected value.
* @param mixed $actual The actual value.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertDiscardWhitespace($expected, $actual, $message = '')
{
}
/**
* Asserts that two values have the same type and value, with EOL differences discarded.
*
* @since 5.6.0
* @since 5.8.0 Added support for nested arrays.
* @since 5.9.0 Added the `$message` parameter.
*
* @param mixed $expected The expected value.
* @param mixed $actual The actual value.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertSameIgnoreEOL($expected, $actual, $message = '')
{
}
/**
* Asserts that two values are equal, with EOL differences discarded.
*
* @since 5.4.0
* @since 5.6.0 Turned into an alias for `::assertSameIgnoreEOL()`.
* @since 5.9.0 Added the `$message` parameter.
*
* @param mixed $expected The expected value.
* @param mixed $actual The actual value.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertEqualsIgnoreEOL($expected, $actual, $message = '')
{
}
/**
* Asserts that the contents of two un-keyed, single arrays are the same, without accounting for the order of elements.
*
* @since 5.6.0
* @since 5.9.0 Added the `$message` parameter.
*
* @param array $expected Expected array.
* @param array $actual Array to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertSameSets($expected, $actual, $message = '')
{
}
/**
* Asserts that the contents of two un-keyed, single arrays are equal, without accounting for the order of elements.
*
* @since 3.5.0
* @since 5.9.0 Added the `$message` parameter.
*
* @param array $expected Expected array.
* @param array $actual Array to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertEqualSets($expected, $actual, $message = '')
{
}
/**
* Asserts that the contents of two keyed, single arrays are the same, without accounting for the order of elements.
*
* @since 5.6.0
* @since 5.9.0 Added the `$message` parameter.
*
* @param array $expected Expected array.
* @param array $actual Array to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertSameSetsWithIndex($expected, $actual, $message = '')
{
}
/**
* Asserts that the contents of two keyed, single arrays are equal, without accounting for the order of elements.
*
* @since 4.1.0
* @since 5.9.0 Added the `$message` parameter.
*
* @param array $expected Expected array.
* @param array $actual Array to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertEqualSetsWithIndex($expected, $actual, $message = '')
{
}
/**
* Asserts that the given variable is a multidimensional array, and that all arrays are non-empty.
*
* @since 4.8.0
* @since 5.9.0 Added the `$message` parameter.
*
* @param array $actual Array to check.
* @param string $message Optional. Message to display when the assertion fails.
*/
public function assertNonEmptyMultidimensionalArray($actual, $message = '')
{
}
/**
* Assert that two text strings representing file paths are the same, while ignoring
* OS-specific differences in the directory separators.
*
* This allows for tests to be compatible for running on both *nix based as well as Windows OS.
*
* @since 6.7.0
*
* @param string $path_a File or directory path.
* @param string $path_b File or directory path.
*/
public function assertSamePathIgnoringDirectorySeparators($path_a, $path_b)
{
}
/**
* Normalize directory separators in a file path to be a forward slash.
*
* @since 6.7.0
*
* @param string $path File or directory path.
* @return string The normalized file or directory path.
*/
public function normalizeDirectorySeparatorsInPath($path)
{
}
/**
* Checks each of the WP_Query is_* functions/properties against expected boolean value.
*
* Any properties that are listed by name as parameters will be expected to be true; all others are
* expected to be false. For example, assertQueryTrue( 'is_single', 'is_feed' ) means is_single()
* and is_feed() must be true and everything else must be false to pass.
*
* @since 2.5.0
* @since 3.8.0 Moved from `Tests_Query_Conditionals` to `WP_UnitTestCase`.
* @since 5.3.0 Formalized the existing `...$prop` parameter by adding it
* to the function signature.
*
* @param string ...$prop Any number of WP_Query properties that are expected to be true for the current request.
*/
public function assertQueryTrue(...$prop)
{
}
/**
* Helper function to convert a single-level array containing text strings to a named data provider.
*
* The value of the data set will also be used as the name of the data set.
*
* Typical usage of this method:
*
* public function data_provider_for_test_name() {
* $array = array(
* 'value1',
* 'value2',
* );
*
* return $this->text_array_to_dataprovider( $array );
* }
*
* The returned result will look like:
*
* array(
* 'value1' => array( 'value1' ),
* 'value2' => array( 'value2' ),
* )
*
* @since 6.1.0
*
* @param array $input Input array.
* @return array Array which is usable as a test data provider with named data sets.
*/
public static function text_array_to_dataprovider($input)
{
}
/**
* Sets the global state to as if a given URL has been requested.
*
* This sets:
* - The super globals.
* - The globals.
* - The query variables.
* - The main query.
*
* @since 3.5.0
*
* @param string $url The URL for the request.
*/
public function go_to($url)
{
}
/**
* Allows tests to be skipped on single or multisite installs by using @group annotations.
*
* This is a custom extension of the PHPUnit requirements handling.
*
* @since 3.5.0
* @deprecated 5.9.0 This method has not been functional since PHPUnit 7.0.
*/
protected function checkRequirements()
{
}
/**
* Skips the current test if there is an open Trac ticket associated with it.
*
* @since 3.5.0
*
* @param int $ticket_id Ticket number.
*/
public function knownWPBug($ticket_id)
{
}
/**
* Skips the current test if there is an open Unit Test Trac ticket associated with it.
*
* @since 3.5.0
* @deprecated No longer used since the Unit Test Trac was merged into the Core Trac.
*
* @param int $ticket_id Ticket number.
*/
public function knownUTBug($ticket_id)
{
}
/**
* Skips the current test if there is an open Plugin Trac ticket associated with it.
*
* @since 3.5.0
*
* @param int $ticket_id Ticket number.
*/
public function knownPluginBug($ticket_id)
{
}
/**
* Adds a Trac ticket number to the `$forced_tickets` property.
*
* @since 3.5.0
*
* @param int $ticket Ticket number.
*/
public static function forceTicket($ticket)
{
}
/**
* Custom preparations for the PHPUnit process isolation template.
*
* When restoring global state between tests, PHPUnit defines all the constants that were already defined, and then
* includes included files. This does not work with WordPress, as the included files define the constants.
*
* This method defines the constants after including files.
*
* @param Text_Template $template The template to prepare.
*/
public function prepareTemplate(\Text_Template $template)
{
}
/**
* Creates a unique temporary file name.
*
* The directory in which the file is created depends on the environment configuration.
*
* @since 3.5.0
*
* @return string|bool Path on success, else false.
*/
public function temp_filename()
{
}
/**
* Selectively deletes a file.
*
* Does not delete a file if its path is set in the `$ignore_files` property.
*
* @param string $file File path.
*/
public function unlink($file)
{
}
/**
* Selectively deletes files from a directory.
*
* Does not delete files if their paths are set in the `$ignore_files` property.
*
* @since 4.0.0
*
* @param string $path Directory path.
*/
public function rmdir($path)
{
}
/**
* Deletes files added to the `uploads` directory during tests.
*
* This method works in tandem with the `set_up()` and `rmdir()` methods:
* - `set_up()` scans the `uploads` directory before every test, and stores
* its contents inside of the `$ignore_files` property.
* - `rmdir()` and its helper methods only delete files that are not listed
* in the `$ignore_files` property. If called during `tear_down()` in tests,
* this will only delete files added during the previously run test.
*/
public function remove_added_uploads()
{
}
/**
* Returns a list of all files contained inside a directory.
*
* @since 4.0.0
*
* @param string $dir Path to the directory to scan.
* @return array List of file paths.
*/
public function files_in_dir($dir)
{
}
/**
* Returns a list of all files contained inside the `uploads` directory.
*
* @since 4.0.0
*
* @return array List of file paths.
*/
public function scan_user_uploads()
{
}
/**
* Deletes all directories contained inside a directory.
*
* @since 4.1.0
*
* @param string $path Path to the directory to scan.
*/
public function delete_folders($path)
{
}
/**
* Retrieves all directories contained inside a directory.
* Hidden directories are ignored.
*
* This is a helper for the `delete_folders()` method.
*
* @since 4.1.0
* @since 6.1.0 No longer sets a (dynamic) property to keep track of the directories,
* but returns an array of the directories instead.
*
* @param string $dir Path to the directory to scan.
* @return string[] List of directories.
*/
public function scandir($dir)
{
}
/**
* Converts a microtime string into a float.
*
* @since 4.1.0
*
* @param string $microtime Time string generated by `microtime()`.
* @return float `microtime()` output as a float.
*/
protected function _microtime_to_float($microtime)
{
}
/**
* Deletes a user from the database in a Multisite-agnostic way.
*
* @since 4.3.0
*
* @param int $user_id User ID.
* @return bool True if the user was deleted.
*/
public static function delete_user($user_id)
{
}
/**
* Resets permalinks and flushes rewrites.
*
* @since 4.4.0
*
* @global WP_Rewrite $wp_rewrite
*
* @param string $structure Optional. Permalink structure to set. Default empty.
*/
public function set_permalink_structure($structure = '')
{
}
/**
* Creates an attachment post from an uploaded file.
*
* @since 4.4.0
* @since 6.2.0 Returns a WP_Error object on failure.
*
* @param array $upload Array of information about the uploaded file, provided by wp_upload_bits().
* @param int $parent_post_id Optional. Parent post ID.
* @return int|WP_Error The attachment ID on success, WP_Error object on failure.
*/
public function _make_attachment($upload, $parent_post_id = 0)
{
}
/**
* Updates the modified and modified GMT date of a post in the database.
*
* @since 4.8.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $post_id Post ID.
* @param string $date Post date, in the format YYYY-MM-DD HH:MM:SS.
* @return int|false 1 on success, or false on error.
*/
protected function update_post_modified($post_id, $date)
{
}
/**
* Touches the given file and its directory if it doesn't already exist.
*
* This can be used to ensure a file that is implicitly relied on in a test exists
* without it having to be built.
*
* @param string $file The file name.
*/
public static function touch($file)
{
}
}
/**
* A class to handle additional command line arguments passed to the script.
*
* If it is determined that phpunit was called with a --group that corresponds
* to an @ticket annotation (such as `phpunit --group 12345` for bugs marked
* as #WP12345), then it is assumed that known bugs should not be skipped.
*
* If WP_TESTS_FORCE_KNOWN_BUGS is already set in wp-tests-config.php, then
* how you call phpunit has no effect.
*/
class WP_PHPUnit_Util_Getopt
{
public function __construct($argv)
{
}
}
/**
* Unit Tests: Basic_Object cloass
*
* @package WordPress
* @subpackage UnitTests
* @since 4.7.0
*/
/**
* Class used to test accessing methods and properties
*
* @since 4.0.0
*/
class Basic_Object
{
public function __get($name)
{
}
public function __set($name, $value)
{
}
public function __isset($name)
{
}
public function __unset($name)
{
}
public function __call($name, $arguments)
{
}
}
/**
* Class used to test accessing methods and properties.
*
* @since 4.0.0
*/
class Basic_Subclass extends \Basic_Object
{
}
/**
* Unit Tests: JsonSerializable_Object
*
* @package WordPress
* @subpackage UnitTests
* @since 5.3.0
*/
class JsonSerializable_Object implements \JsonSerializable
{
public function __construct($data)
{
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
}
}
/**
* WP_Fake_Block_Type for testing
*
* @package WordPress
* @subpackage Blocks
* @since 5.0.0
*/
/**
* Test class extending WP_Block_Type
*
* @since 5.0.0
*/
class WP_Fake_Block_Type extends \WP_Block_Type
{
/**
* Render the fake block.
*
* @param array $attributes Optional. Block attributes. Default empty array.
* @param string $content Optional. Block content. Default empty string.
* @return string Rendered block HTML.
*/
public function render($attributes = array(), $content = '')
{
}
}
/**
* Unit tests covering WP_REST_Controller functionality using a flexible schema.
*
* @package WordPress
* @subpackage REST API
* @since 5.4.0
*/
/**
* WP_REST_Test_Configurable_Controller class.
*
* @group restapi
*
* @since 5.4.0
*/
class WP_REST_Test_Configurable_Controller extends \WP_REST_Controller
{
/**
* Test schema.
*
* @since 5.4.0
*
* @var array $test_schema
*/
protected $test_schema;
/**
* Class constructor.
*
* @since 5.4.0
*
* @param array $test_schema Schema for use in testing.
*/
public function __construct($test_schema)
{
}
/**
* Provides the test schema.
*
* @since 5.4.0
*
* @return array Test schema.
*/
public function get_test_schema()
{
}
/**
* Get the item's schema, conforming to JSON Schema.
*
* @since 5.4.0
*
* @return array
*/
public function get_item_schema()
{
}
}
/**
* REST API: WP_REST_Test_Search_Handler class
*
* @package WordPress
* @subpackage REST_API
*/
/**
* Test class extending WP_REST_Search_Handler
*/
class WP_REST_Test_Search_Handler extends \WP_REST_Search_Handler
{
protected $items = array();