From d9ee03a29ab928a53217d309bbce42ed7be38ff9 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Thu, 12 Oct 2023 11:08:56 -0300 Subject: [PATCH] updating tests --- .../font-library/wpFontLibrary/registerFontCollection.php | 2 ++ .../wpFontLibrary/unregisterFontCollection.php | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php b/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php index 6bc5fbb8161ce..f23f2a76c6520 100644 --- a/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php +++ b/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php @@ -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.' ); diff --git a/phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php b/phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php index 0e4c72318ec25..ee864cd894ff3 100644 --- a/phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php +++ b/phpunit/tests/fonts/font-library/wpFontLibrary/unregisterFontCollection.php @@ -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' );