Conversation
Add phpunit GH action
rtBot
left a comment
There was a problem hiding this comment.
phpcs scanning turned up:
🚫 13 errors
hashes-api-scanning skipped
Posting will continue in further review(s)
tests/test-sample.php
Outdated
| @@ -0,0 +1,20 @@ | |||
| <?php | |||
There was a problem hiding this comment.
| }); | ||
| add_filter( 'pre_option_stylesheet', function() use ( $current_theme ) { | ||
| return $current_theme; | ||
| }); |
There was a problem hiding this comment.
🚫 Error: Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine).
| add_filter( 'pre_option_template', function() use ( $current_theme ) { | ||
| return $current_theme; | ||
| }); | ||
| add_filter( 'pre_option_stylesheet', function() use ( $current_theme ) { |
There was a problem hiding this comment.
🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).
| add_filter( 'pre_option_template', function() use ( $current_theme ) { | ||
| return $current_theme; | ||
| }); | ||
| add_filter( 'pre_option_stylesheet', function() use ( $current_theme ) { |
There was a problem hiding this comment.
🚫 Error: Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket).
|
|
||
| add_filter( 'pre_option_template', function() use ( $current_theme ) { | ||
| return $current_theme; | ||
| }); |
There was a problem hiding this comment.
🚫 Error: Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine).
|
|
||
| register_theme_directory( $theme_root ); | ||
|
|
||
| add_filter( 'pre_option_template', function() use ( $current_theme ) { |
There was a problem hiding this comment.
🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).
|
|
||
| register_theme_directory( $theme_root ); | ||
|
|
||
| add_filter( 'pre_option_template', function() use ( $current_theme ) { |
There was a problem hiding this comment.
🚫 Error: Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket).
|
|
||
| add_filter( 'theme_root', function() use ( $theme_root ) { | ||
| return $theme_root; | ||
| } ); |
There was a problem hiding this comment.
🚫 Error: Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine).
| $current_theme = basename( $theme_dir ); | ||
| $theme_root = dirname( $theme_dir ); | ||
|
|
||
| add_filter( 'theme_root', function() use ( $theme_root ) { |
There was a problem hiding this comment.
🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).
| $current_theme = basename( $theme_dir ); | ||
| $theme_root = dirname( $theme_dir ); | ||
|
|
||
| add_filter( 'theme_root', function() use ( $theme_root ) { |
There was a problem hiding this comment.
🚫 Error: Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket).
|
|
||
| $theme_dir = dirname( __DIR__ ); | ||
| $current_theme = basename( $theme_dir ); | ||
| $theme_root = dirname( $theme_dir ); |
There was a problem hiding this comment.
| */ | ||
| function _register_theme() { | ||
|
|
||
| $theme_dir = dirname( __DIR__ ); |
There was a problem hiding this comment.
| /** | ||
| * Registers theme | ||
| */ | ||
| function _register_theme() { |
There was a problem hiding this comment.
🚫 Error: Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "_register_theme" (WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound).
| } | ||
|
|
||
| if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) { | ||
| echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; |
There was a problem hiding this comment.
🚫 Error: All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '"Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?"' (WordPress.Security.EscapeOutput.OutputNotEscaped).
| $_tests_dir = getenv( 'WP_TESTS_DIR' ); | ||
|
|
||
| if ( ! $_tests_dir ) { | ||
| $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; |
There was a problem hiding this comment.
🚫 Error: Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$_tests_dir" (WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound).
| * @package Blank_Theme | ||
| */ | ||
|
|
||
| $_tests_dir = getenv( 'WP_TESTS_DIR' ); |
There was a problem hiding this comment.
🚫 Error: Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$_tests_dir" (WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound).
| @@ -0,0 +1,48 @@ | |||
| <?php | |||
There was a problem hiding this comment.
Update Readme with Contributing guideline and Add tests folder to skip_folders list
rtBot
left a comment
There was a problem hiding this comment.
phpcs scanning turned up:
🚫 1 error
hashes-api-scanning skipped
inc/classes/class-customizer.php
Outdated
| * @codeCoverageIgnore | ||
| */ | ||
| public function enqueue_customizer_scripts() { | ||
| wp_enqueue_script( |
There was a problem hiding this comment.
🚫 Error: Version parameter is not explicitly set or has been set to an equivalent of "false" for wp_enqueue_script; This means that the WordPress core version will be used which is not recommended for plugin or theme development (WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion).
inc/classes/class-customizer.php
Outdated
| } | ||
|
|
||
| if ( ! empty( $wp_customize->get_setting( 'blogdescription' ) ) ) { | ||
| $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
There was a problem hiding this comment.
inc/classes/class-customizer.php
Outdated
| $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; | ||
| $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; | ||
| if ( ! empty( $wp_customize->get_setting( 'blogname' ) ) ) { | ||
| $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
There was a problem hiding this comment.
rtBot
left a comment
There was a problem hiding this comment.
phpcs scanning turned up:
🚫 1 error
hashes-api-scanning skipped
inc/classes/class-customizer.php
Outdated
| get_template_directory_uri() . '/assets/build/js/admin/customizer.js', | ||
| [ 'customize-preview' ], | ||
| false, | ||
| false, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion |
There was a problem hiding this comment.
🚫 Error: Only one argument is allowed per line in a multi-line function call (PEAR.Functions.FunctionCallSignature.MultipleArguments).
sagarnasit
left a comment
There was a problem hiding this comment.
@deepaklalwani97 Added couple of feedback, everything else looks good.
| - Sync complete `build` directory on server. | ||
| - Before code push to repository, make sure you lint your code using `npm run precommit` command. | ||
|
|
||
| ## Contributing |
There was a problem hiding this comment.
We slightly updated our contributor's workflow content, To align with that please update flow here. You can refer https://github.com/rtCamp/edit-flow-slack-integration
| $this->assertEquals( 10, has_filter( 'excerpt_more', array( $this->instance, 'add_read_more_link' ) ) ); | ||
| $this->assertEquals( 10, has_filter( 'body_class', array( $this->instance, 'filter_body_classes' ) ) ); | ||
| $this->assertEquals( 10, has_action( 'wp_head', array( $this->instance, 'add_pingback_link' ) ) ); |
There was a problem hiding this comment.
are these duplicate test cases? does looping through $hooks cover this test cases?
|
@deepaklalwani97 I see lines are not 100% covered in test cases. Please add files for which test cases are not needed in the unit test ignore. |
Add doc description for test functions
Sync dev-unit-test branch with master and fix unit test cases
Fixes Php Unit test case setup #33