alleyinteractive / alleyinteractive/mantle-framework

Preserve and reset user roles and capabilities between test runs

Ouverte
#828 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
PHP
Étoiles
28
Forks
7
Merge moyen
2 j 4 h
PR mergées (30 j)
2

Description

Continuing from https://github.com/alleyinteractive/mantle-framework/issues/826...

> Mantle is currently taking too aggressive of a stance when cleaning up between test runs. Right now, it [resets all meta keys](https://github.com/alleyinteractive/mantle-framework/blob/72bc20b307db22ec439b61250eeeb46e84682a5a/src/mantle/testing/TestCase.php#L274) in the tear down for each test run. This can cause issues when attempting to use meta that was registered on `init` before the test case even started.

We should make it possible to reset the `$wp_roles` global between test runs. The global should be backed up before any test begins and then restored at the start of each run.

This should be an opt-in feature and not something included with the framework by default.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.