This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update package name and add unit test for WritePoetry class
- Loading branch information
Giacomo Secchi
committed
Mar 2, 2024
1 parent
110f0e3
commit 26b89ac
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* Class SampleTest | ||
* | ||
* @package Write_Poetry | ||
* @package WritePoetry | ||
*/ | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); | ||
} | ||
} |