Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mreishus committed Sep 25, 2024
1 parent bb9aa49 commit c8156a1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ public function test_register_collection_with_valid_plugin_path() {

public function test_register_collection_with_invalid_plugin_path() {
$invalid_plugin_path = WP_PLUGIN_DIR;
$result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file );

$this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' );

$result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file );
$this->assertFalse( $result, 'Invalid plugin path should not be registered' );
}

public function test_register_collection_with_non_existent_path() {
$non_existent_path = '/path/that/does/not/exist';
$result = WP_Block_Metadata_Registry::register_collection( $non_existent_path, $this->temp_manifest_file );

$this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' );

$result = WP_Block_Metadata_Registry::register_collection( $non_existent_path, $this->temp_manifest_file );
$this->assertFalse( $result, 'Non-existent path should not be registered' );
}
}

0 comments on commit c8156a1

Please sign in to comment.