Skip to content

Commit

Permalink
Tests: Ignore view/controller code with minimal coverage value
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Feb 8, 2023
1 parent 695a61a commit 0d61135
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
</testsuites>
<coverage processUncoveredFiles="false">
<include>
<directory suffix=".php">includes</directory>
<directory suffix=".php">providers</directory>
<file>class-two-factor-compat.php</file>
<file>class-two-factor-core.php</file>
<file>two-factor.php</file>
</include>
<exclude>
<file>includes/function.login-footer.php</file>
<file>includes/function.login-header.php</file>
</exclude>
<report>
<clover outputFile="tests/logs/clover.xml" />
</report>
Expand Down
6 changes: 6 additions & 0 deletions providers/class-two-factor-backup-codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public static function get_instance() {
* Class constructor.
*
* @since 0.1-dev
*
* @codeCoverageIgnore
*/
protected function __construct() {
add_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );
Expand All @@ -57,6 +59,8 @@ protected function __construct() {

/**
* Register the rest-api endpoints required for this provider.
*
* @codeCoverageIgnore
*/
public function register_rest_routes() {
register_rest_route(
Expand Down Expand Up @@ -95,6 +99,8 @@ public function register_rest_routes() {
* Displays an admin notice when backup codes have run out.
*
* @since 0.1-dev
*
* @codeCoverageIgnore
*/
public function admin_notices() {
$user = wp_get_current_user();
Expand Down
4 changes: 4 additions & 0 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ protected function __construct() {

/**
* Register the rest-api endpoints required for this provider.
*
* @codeCoverageIgnore
*/
public function register_rest_routes() {
register_rest_route(
Expand Down Expand Up @@ -119,6 +121,8 @@ public function get_label() {

/**
* Enqueue scripts
*
* @codeCoverageIgnore
*/
public function enqueue_assets( $hook_suffix ) {
$environment_prefix = file_exists( TWO_FACTOR_DIR . '/dist' ) ? '/dist' : '';
Expand Down

0 comments on commit 0d61135

Please sign in to comment.