Migrate tests/unit folder to WordPress Coding Standard

[MAILPOET-6240]
This commit is contained in:
Jan Lysý
2024-11-04 12:21:28 +01:00
committed by Jan Lysý
parent d0f8d6f83e
commit d0c8cde59c
4 changed files with 87 additions and 20 deletions

View File

@@ -1,16 +1,41 @@
<?php declare(strict_types = 1);
<?php
/**
* This file is part of the MailPoet plugin.
*
* @package MailPoet\EmailEditor
*/
declare(strict_types = 1);
$console = new \Codeception\Lib\Console\Output( array() );
if ( ! function_exists( 'esc_attr' ) ) {
/**
* Mock esc_attr function.
*
* @param string $attr Attribute to escape.
*/
function esc_attr( $attr ) {
return $attr;
}
}
/**
* Base class for unit tests.
*/
abstract class MailPoetUnitTest extends \Codeception\TestCase\Test {
protected $runTestInSeparateProcess = false;
protected $preserveGlobalState = false;
/**
* Disable running tests in separate processes.
*
* @var bool
*/
protected $runTestInSeparateProcess = false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
/**
* Disable preserving global state.
*
* @var bool
*/
protected $preserveGlobalState = false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase
}
require '_stubs.php';