File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,10 @@ function init_temp_dir() {
330
330
*/
331
331
function export () {
332
332
// Extend PHP execution time to prevent timeouts
333
- @set_time_limit (0 );
333
+ // Don't apply in test environment to avoid interfering with tests
334
+ if ( ! defined ( 'WP_TESTS_DOMAIN ' ) ) {
335
+ set_time_limit (0 );
336
+ }
334
337
335
338
do_action ( 'jekyll_export ' );
336
339
ob_start ();
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Test file to check if set_time_limit(0) is working correctly
4
+ */
5
+
6
+ // Include the plugin file
7
+ require_once __DIR__ . '/jekyll-exporter.php ' ;
8
+
9
+ // Create a mock instance of the class
10
+ class TimeoutTestExporter extends Jekyll_Export {
11
+ public function test_export () {
12
+ // Call the export method with output buffering
13
+ ob_start ();
14
+ $ this ->export ();
15
+ ob_end_clean ();
16
+
17
+ echo "Export completed successfully without timeout. \n" ;
18
+ }
19
+ }
20
+
21
+ // Create an instance and test
22
+ $ test_exporter = new TimeoutTestExporter ();
23
+ $ test_exporter ->test_export ();
24
+
25
+ echo "Test completed. \n" ;
You can’t perform that action at this time.
0 commit comments