Skip to content

administrator test failing #18

Open

Description

@s22-tech

Running the administrator.php test, I get these results:

 $administrator->data -- Array
(
    [id] => 3
    [status] => 0
    [username] => test2
    [firstname] => 
    [lastname] => 
    [email] => test2@example.com
    [password_hash] => $2y$12$LUYnw4YacJADZk7biYh7GudGFykbpIS/FcfgvzCzXxWZGHlgvsHpW
    [apps] => Array
        (
        )

    [widgets] => Array
        (
        )

    [two_factor_auth] => 0
    [known_ips] => 
    [known_fingerprints] => 
    [login_attempts] => 0
    [total_logins] => 0
    [last_ip_address] => 
    [last_hostname] => 
    [last_user_agent] => 
    [valid_from] => 2024-01-01 00:00:00
    [valid_to] => 2024-12-31 23:59:59
    [last_active] => 
    [last_login] => 
    [updated_at] => 2026-06-28 10:07:18
    [created_at] => 2026-06-28 10:07:18
)
 administrator::$data -- Array
(
    [id] => 3
    [status] => 0
    [username] => test2
    [firstname] => 
    [lastname] => 
    [email] => test2@example.com
    [password_hash] => $2y$12$LUYnw4YacJADZk7biYh7GudGFykbpIS/FcfgvzCzXxWZGHlgvsHpW
    [apps] => Array
        (
        )

    [widgets] => Array
        (
        )

    [two_factor_auth] => 0
    [known_ips] => Array
        (
        )

    [known_fingerprints] => Array
        (
        )

    [login_attempts] => 0
    [total_logins] => 0
    [last_ip_address] => 
    [last_hostname] => 
    [last_user_agent] => 
    [valid_from] => 2024-01-01 00:00:00
    [valid_to] => 2024-12-31 23:59:59
    [last_active] => 
    [last_login] => 
    [updated_at] => 2026-06-28 10:07:18
    [created_at] => 2026-06-28 10:07:18
)
[Failed] Error: administrator::$data does not match $administrator->data

It appears that known_fingerprints may be the culprit -- in $administrator->data it looks to be an empty string, in administrator::$data it's an empty array.

I had mentioned before that known_fingerprints was missing from lc_administrators so I added it as a varchar.

Any idea why this test is failing?

Activity

  1. s22-tech commented on Jul 16, 2026

    @s22-tech
    ContributorAuthor

    I ran this again after I updated known_fingerprints but it still fails. It looks like string_split() in nod_administrator is converting those variables into arrays while ent_administrator does not.

    $administrator['known_ips'] = f::string_split($administrator['known_ips']);
    $administrator['known_fingerprints'] = f::string_split($administrator['known_fingerprints']);
    

    Here's the output:

    $administrator->data

    Array
    (
        [apps] => Array
            (
            )
    
        [blocked_until] => 
        [created_at] => 2026-07-15 20:55:34
        [email] => test2@example.com
        [firstname] => 
        [id] => 3
        [known_fingerprints] => 
        [known_ips] => 
        [last_active] => 
        [last_hostname] => 
        [last_ip_address] => 
        [last_login] => 
        [last_user_agent] => 
        [lastname] => 
        [login_attempts] => 0
        [password_hash] => $2y$12$Gvn.8.l96lAnw4y0Mdq4Debr0aeBdwgG8Dl5ZEaEX6Bg23UXFZb4e
        [permissions] => 
        [sessions_expiry] => 
        [status] => 0
        [total_logins] => 0
        [totp_secret] => 
        [two_factor_auth] => 0
        [updated_at] => 2026-07-15 20:55:34
        [username] => test2
        [valid_from] => 2024-01-01 00:00:00
        [valid_to] => 2024-12-31 23:59:59
        [widgets] => Array
            (
            )
    
    )
    

    administrator::$data

    Array
    (
        [apps] => Array
            (
            )
    
        [blocked_until] => 
        [created_at] => 2026-07-15 20:55:34
        [email] => test2@example.com
        [firstname] => 
        [id] => 3
        [known_fingerprints] => Array
            (
            )
    
        [known_ips] => Array
            (
            )
    
        [last_active] => 
        [last_hostname] => 
        [last_ip_address] => 
        [last_login] => 
        [last_user_agent] => 
        [lastname] => 
        [login_attempts] => 0
        [password_hash] => $2y$12$Gvn.8.l96lAnw4y0Mdq4Debr0aeBdwgG8Dl5ZEaEX6Bg23UXFZb4e
        [permissions] => 
        [sessions_expiry] => 
        [status] => 0
        [total_logins] => 0
        [totp_secret] => 
        [two_factor_auth] => 0
        [updated_at] => 2026-07-15 20:55:34
        [username] => test2
        [valid_from] => 2024-01-01 00:00:00
        [valid_to] => 2024-12-31 23:59:59
        [widgets] => Array
            (
            )
    
    )
    [Failed] Error: administrator::$data does not match $administrator->data
    
  2. timint commented on Jul 16, 2026

    @timint
    Collaborator

    I think this was resolved in LiteCart v3 and we are just waiting for the next sync. The solution is to universally convert fingerprints to an array in both components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions