Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mukeshpanchal27 committed Nov 9, 2023
1 parent bba8ba5 commit 599e1c3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/phpunit/Checker/Checks/Plugin_Readme_Check_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,20 @@ public function test_run_root_readme_file_without_errors() {
$this->assertEquals( 0, $check_result->get_error_count() );
$this->assertEquals( 0, $check_result->get_warning_count() );
}

public function test_single_file_plugin_without_error_for_trademarks() {
$readme_check = new Plugin_Readme_Check();
$check_context = new Check_Context( WP_PLUGIN_DIR . '/single-file-plugin.php' );
$check_result = new Check_Result( $check_context );

$readme_check->run( $check_result );

$errors = $check_result->get_errors();
$warnings = $check_result->get_warnings();

$this->assertEmpty( $errors );
$this->assertEmpty( $warnings );
$this->assertSame( 0, $check_result->get_error_count() );
$this->assertSame( 0, $check_result->get_warning_count() );
}
}
17 changes: 17 additions & 0 deletions tests/phpunit/Checker/Checks/Trademarks_Check_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,21 @@ public function test_trademarks_with_for_woocommerce_exceptions() {
$this->assertEmpty( $errors );
$this->assertSame( 0, $check_result->get_error_count() );
}

public function test_single_file_plugin_without_error_for_trademarks() {
$trademarks_check = new Trademarks_Check();
$check_context = new Check_Context( WP_PLUGIN_DIR . '/single-file-plugin.php' );
$check_result = new Check_Result( $check_context );

$trademarks_check->run( $check_result );

$errors = $check_result->get_errors();
$warnings = $check_result->get_warnings();

$this->assertEmpty( $errors );
$this->assertEmpty( $warnings );

$this->assertSame( 0, $check_result->get_error_count() );
$this->assertSame( 0, $check_result->get_warning_count() );
}
}

0 comments on commit 599e1c3

Please sign in to comment.