Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Oct 12, 2023
1 parent 6f2ba86 commit d9ee03a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public function test_should_return_error_if_id_is_repeated() {
$collection1 = WP_Font_Library::register_font_collection( $config1 );
$this->assertInstanceOf( 'WP_Font_Collection', $collection1, 'A collection should be registered.' );

// Expects a _doing_it_wrong notice.
$this->setExpectedIncorrectUsage( 'WP_Font_Library::register_font_collection' );
// Try to register a second collection with same id.
$collection2 = WP_Font_Library::register_font_collection( $config2 );
$this->assertWPError( $collection2, 'Second collection with the same id should fail.' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ public function set_up() {
WP_Font_Library::register_font_collection( $config );
}

public function tear_down() {
// Resets the private static property WP_Font_Library::$unregistered_collection_ids to empty array.
$reflection = new ReflectionClass( 'WP_Font_Library' );
$property = $reflection->getProperty( 'unregistered_collection_ids' );
$property->setAccessible( true );
$property->setValue( array() );
}

public function test_should_unregister_font_collection() {
// Unregister mock font collection.
WP_Font_Library::unregister_font_collection( 'mock-font-collection-1' );
Expand Down

0 comments on commit d9ee03a

Please sign in to comment.