Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Update package name and add unit test for WritePoetry class
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Secchi committed Mar 2, 2024
1 parent 110f0e3 commit 26b89ac
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Class SampleTest
*
* @package Write_Poetry
* @package WritePoetry
*/

/**
Expand Down
36 changes: 36 additions & 0 deletions tests/test-writepoetry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Class SampleTest
*
* @package WritePoetry
*/

/**
* Sample test case.
*/
class WritePoetryTest extends WP_UnitTestCase {

/**
* A single example test.
*/
public function set_up() {
parent::set_up();

// Mock that we're in WP Admin context.
// See https://wordpress.stackexchange.com/questions/207358/unit-testing-in-the-wordpress-backend-is-admin-is-true
set_current_screen( 'edit-post' );

$this->write_poetry = WritePoetry\Init::register_services();

}

public function tear_down() {
parent::tear_down();
}

public function test_has_settings_interface() {
$has_settings_interface = ( is_a( $this->write_poetry->settings, 'Starter_Plugin_Settings' ) );

$this->assertTrue( $has_settings_interface );
}
}

0 comments on commit 26b89ac

Please sign in to comment.