Skip to content

A free open source IT asset/license management system

This test was flaky, probably due to the PHP statcache.

Brady Wetherington4ef307276664
diff --git a/tests/Unit/LdapTest.php b/tests/Unit/LdapTest.php
index a492b1efbc..538f542ebb 100644
--- a/tests/Unit/LdapTest.php
+++ b/tests/Unit/LdapTest.php
@@ -228,6 +228,7 @@ class LdapTest extends TestCase
$this->settings->enableLdap()->set(['ldap_client_tls_cert' => 'SAMPLE CERT TEXT']);
$client_side_cert_path = Setting::get_client_side_cert_path();
file_put_contents($client_side_cert_path, 'WEIRDLY UPDATED CERT FILE');
+ clearstatcache();
//the system should respect our cache-file, since the settings haven't been updated
$possibly_recached_cert_file = Setting::get_client_side_cert_path(); //this should *NOT* re-cache from the Settings
$this->assertStringEqualsFile($possibly_recached_cert_file, 'WEIRDLY UPDATED CERT FILE');