Added sniffs to enforce PSR-4 in the `src` and `tests/php/src` directories

This commit is contained in:
Christopher Allford 2020-07-15 16:09:00 -07:00
parent f72b8db576
commit b71ddd35f1
3 changed files with 14 additions and 11 deletions

View File

@ -43,8 +43,19 @@
<rule ref="WordPress.Files.FileName.InvalidClassFileName"> <rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>includes/**/abstract-*.php</exclude-pattern> <exclude-pattern>includes/**/abstract-*.php</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern> <exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>src/*</exclude-pattern> <exclude-pattern>src/</exclude-pattern>
<exclude-pattern>tests/php/src/</exclude-pattern>
</rule>
<rule ref="Squiz.Classes.ClassFileName">
<include-pattern>src/</include-pattern>
<include-pattern>tests/php/src/</include-pattern>
</rule>
<rule ref="Squiz.Classes.ValidClassName">
<include-pattern>src/</include-pattern>
<include-pattern>tests/php/src/</include-pattern>
</rule> </rule>
<rule ref="Generic.Commenting"> <rule ref="Generic.Commenting">

View File

@ -1 +0,0 @@
# Placeholder to include the folder. Remove once tests have been written!

View File

@ -1,18 +1,11 @@
<?php <?php
/**
* Tests for ConnectionHelper for WCCom
*
* @package WooCommerce|Tests|Internal|WCCom.
*/
namespace Automattic\WooCommerce\Tests\Internal; namespace Automattic\WooCommerce\Tests\Internal\WCCom;
use Automattic\WooCommerce\Internal\WCCom\ConnectionHelper; use Automattic\WooCommerce\Internal\WCCom\ConnectionHelper;
/** /**
* Class ConnectionHelperTest. * Class ConnectionHelperTest.
*
* @package Automattic\WooCommerce\Tests\Internal.
*/ */
class ConnectionHelperTest extends \WC_Unit_Test_Case { class ConnectionHelperTest extends \WC_Unit_Test_Case {