Skip to content

Commit

Permalink
Merge branch '5' into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Feb 24, 2025
2 parents 038af08 + 4d950df commit e9d95b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Dev/SapphireTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ abstract class SapphireTest extends TestCase implements TestOnly

protected FixtureFactory|bool $fixtureFactory;

/**
* The original value of ini 'max_execution_time' before any code or tests change it
*/
private int $origMaxExecutionTime;

/**
* @return TempDatabase
*/
Expand Down Expand Up @@ -341,6 +346,8 @@ protected function setUp(): void
Email::config()->remove('send_all_emails_from');
Email::config()->remove('cc_all_emails_to');
Email::config()->remove('bcc_all_emails_to');

$this->origMaxExecutionTime = ini_get('max_execution_time');
}

/**
Expand Down Expand Up @@ -612,6 +619,10 @@ protected function tearDown(): void
restore_error_handler();
$this->oldErrorHandler = null;
}

// Reset max_execution_time in case some code or a unit test changed it,
// either via ini_set() or set_time_limit()
ini_set('max_execution_time', $this->origMaxExecutionTime);
}

/**
Expand Down

0 comments on commit e9d95b9

Please sign in to comment.