Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Allow choosing tables to truncate #46025

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

emargareten
Copy link
Contributor

Currently when using DatabaseTruncation trait, there is no option to choose which tables should be truncated, I can either exclude all other tables in the $exceptTables array or it will go through all tables and attempt to truncate (which can be slow for databases with a lot of tables).

With this PR we can choose the tables for truncation by defining a $tablesToTruncate property.

class AuthenticationTest extends DuskTestCase
{
    use DatabaseTruncation;

    /**
     * Indicates which tables should be truncated.
     *
     * @var array
     */
    protected $tablesToTruncate = ['users'];

    //...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants