Updates some tests and the fetch_metadata_type function to do not return control metadata

This commit is contained in:
mateuswetah 2020-09-16 15:41:35 -03:00
parent 3a83a8d0ae
commit d9da6bae70
2 changed files with 2 additions and 2 deletions

View File

@ -653,7 +653,7 @@ class Metadata extends Repository {
do_action( 'register_metadata_types' );
return array_filter($this->metadata_types, function($metadata_type) {
return array_filter($this->metadata_types, function($metadata_type) use ($output) {
if ( $metadata_type != 'Tainacan\Metadata_Types\Control') {
return $output === 'NAME' ? str_replace( 'Tainacan\Metadata_Types\\', '', $metadata_type ) : $metadata_type;
}

View File

@ -136,7 +136,7 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase {
$data = $response_defaults->get_data();
$this->assertCount(1, $data);
$this->assertCount(3, $data);
$this->assertEquals('default', $data[0]['collection_id']);
$this->assertEquals('Data 2', $data[0]['name']);