<?php
use App\Ldap\User;
use LdapRecord\Laravel\Testing\DirectoryEmulator;
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use Tests\TestCase;
class LdapTest extends TestCase
{
#[DoesNotPerformAssertions]
public function test_directory_emulator(): void
{
DirectoryEmulator::setup();
$user = new User();
$user->foo = 'foo';
$user->save();
}
}
Environment:
Describe the bug: I have created a repository to reproduce this bug: https://github.com/mll-lab/ldap-record-directory-emulator-bug.
Starting from a fresh Laravel installation in https://github.com/mll-lab/ldap-record-directory-emulator-bug/commit/9d68715c5dac33a24d221d40cc5a843dee6c97ca, I installed Version 3.2 of this package in https://github.com/mll-lab/ldap-record-directory-emulator-bug/commit/bbaf019a87a4d2ea04d43dddc3289c6ecf98a84c. At this point, running tests works fine.
The test is set up like this:
However, setting
logging.channel
tonull
inconfig/ldap.php
(https://github.com/mll-lab/ldap-record-directory-emulator-bug/commit/a1a66b7013967432f111fdee7f657c78d7cdc52a) causes the following issue when running tests:Weirdly. the issue goes away when running just the
LdapTest
:The issue goes away with https://github.com/mll-lab/ldap-record-directory-emulator-bug/commit/a20ca8a27324bc75b2d40c173dfacc3d72f764a6 which uses the change proposed in https://github.com/DirectoryTree/LdapRecord-Laravel/pull/636.