File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -783,6 +783,28 @@ public function test_generated_dns_properly_substitute_base_on_creation()
783783 $ this ->assertEquals ('cn=foo,dc=local,dc=com ' , $ model ->getDn ());
784784 }
785785
786+ public function test_attribute_values_are_numerically_indexed_on_create ()
787+ {
788+ Container::addConnection (new Connection ([
789+ 'base_dn ' => 'dc=local,dc=com ' ,
790+ ]));
791+
792+ DirectoryFake::setup ()->getLdapConnection ()->expect (
793+ LdapFake::operation ('add ' )->once ()->with (fn ($ dn ) => true , fn ($ attributes ) => (
794+ collect ($ attributes )->every (fn ($ values ) => array_is_list ($ values ))
795+ ))->andReturnTrue (),
796+ );
797+
798+ $ model = new Entry ;
799+
800+ $ model ->objectclass = ['bar ' ];
801+ $ model ->cn = ['invalid ' => 'John Doe ' ];
802+
803+ $ model ->save ();
804+
805+ $ this ->assertEquals ($ model ->cn , ['John Doe ' ]);
806+ }
807+
786808 public function test_setting_dn_attributes_set_distinguished_name_on_model ()
787809 {
788810 $ this ->assertEquals ('foo ' , (new Entry (['distinguishedname ' => 'foo ' ]))->getDn ());
You can’t perform that action at this time.
0 commit comments