Added some exceptions to the PHPCS standards for unit tests

The file comments and @throws tags are unnecessary in unit tests.
This commit is contained in:
Christopher Allford 2020-07-15 14:29:13 -07:00
parent 55385f6cec
commit f72b8db576
5 changed files with 11 additions and 30 deletions

View File

@ -25,7 +25,7 @@
<arg name="parallel" value="8" />
<!-- Configs -->
<config name="minimum_supported_wp_version" value="5.0" />
<config name="minimum_supported_wp_version" value="5.2" />
<config name="testVersion" value="7.0-" />
<!-- Rules -->
@ -61,4 +61,12 @@
<exclude-pattern>tests/php</exclude-pattern>
<exclude-pattern>tests/Tools/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
<exclude-pattern>tests/php/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>tests/php/</exclude-pattern>
</rule>
</ruleset>

View File

@ -1,9 +1,4 @@
<?php
/**
* Class WC_Helper_API unit tests.
*
* @package WooCommerce\Tests\Importer
*/
/**
* Test class for WC_Helper_API.
@ -22,8 +17,6 @@ class WC_Tests_Helper_API extends WC_Unit_Test_Case {
/**
* Test that the url method returns the correct WooCommerce.com path.
*
* @return void
*/
public function test_api_url() {
$url = WC_Helper_API::url( '/test-path' );
@ -32,8 +25,6 @@ class WC_Tests_Helper_API extends WC_Unit_Test_Case {
/**
* Test a GET request through the WC_Helper_API.
*
* @return void
*/
public function test_get_request() {
$request = WC_Helper_API::get(
@ -45,8 +36,6 @@ class WC_Tests_Helper_API extends WC_Unit_Test_Case {
/**
* Test a POST request through the WC_Helper_API.
*
* @return void
*/
public function test_post_request() {
$request = WC_Helper_API::post(
@ -58,8 +47,6 @@ class WC_Tests_Helper_API extends WC_Unit_Test_Case {
/**
* Test a PUT request through the WC_Helper_API.
*
* @return void
*/
public function test_put_request() {
$request = WC_Helper_API::put(

View File

@ -1,9 +1,4 @@
<?php
/**
* Class WC_Tests_WC_Helper file.
*
* @package WooCommerce|Tests|WC_Helper.
*/
/**
* Class WC_Tests_WC_Helper.

View File

@ -1,13 +1,9 @@
<?php
/**
* Class WC_Product_CSV_Importer_Controller_Test
* @package WooCommerce\Tests\Admin
*
* Tests to ensure that the CSV product importer works as expected.
*/
/**
* Class WC_Product_CSV_Importer_Controller_Test
*
* Tests to ensure that the CSV product importer works as expected.
*/
class WC_Product_CSV_Importer_Controller_Test extends WC_Unit_Test_Case {

View File

@ -1,9 +1,4 @@
<?php
/**
* Class WCInstallTest file.
*
* @package WooCommerce|Tests|WCInstallTest.
*/
/**
* Class WC_Install_Test.