Add excluded rule for tests to avoid repetition
Our tests use method _after and _before, so we would need to add ignore to each usage. [MAILPOET-6240]
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
<exclude-pattern>tests/unit/_bootstrap.php</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<!-- Exclude test files from the PSR2.Methods.MethodDeclaration.Underscore rule due to methods _after() and _before() -->
|
||||
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
|
||||
<exclude-pattern>tests/integration</exclude-pattern>
|
||||
<exclude-pattern>tests/unit</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<!-- Skip the vendor directory -->
|
||||
<exclude-pattern>vendor/*</exclude-pattern>
|
||||
</ruleset>
|
||||
|
@@ -24,7 +24,7 @@ class Highlighting_Postprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test.
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->postprocessor = new Highlighting_Postprocessor();
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ class Variables_Postprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->theme_controller_mock = $this->createMock( Theme_Controller::class );
|
||||
$this->postprocessor = new Variables_Postprocessor( $this->theme_controller_mock );
|
||||
|
@@ -39,7 +39,7 @@ class Blocks_Width_Preprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->preprocessor = new Blocks_Width_Preprocessor();
|
||||
$this->layout = array( 'contentSize' => '660px' );
|
||||
|
@@ -57,7 +57,7 @@ class Cleanup_Preprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->preprocessor = new Cleanup_Preprocessor();
|
||||
$this->layout = array( 'contentSize' => '660px' );
|
||||
|
@@ -39,7 +39,7 @@ class Spacing_Preprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->preprocessor = new Spacing_Preprocessor();
|
||||
$this->layout = array( 'contentSize' => '660px' );
|
||||
|
@@ -40,7 +40,7 @@ class Typography_Preprocessor_Test extends \MailPoetUnitTest {
|
||||
/**
|
||||
* Set up the test
|
||||
*/
|
||||
public function _before() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$settings_mock = $this->createMock( Settings_Controller::class );
|
||||
$theme_mock = $this->createMock( \WP_Theme_JSON::class );
|
||||
|
Reference in New Issue
Block a user