remove uselesss registration and duplicated test

This commit is contained in:
Leo Germani 2018-02-23 09:00:45 -03:00
parent ecd8a22207
commit 483642d4eb
2 changed files with 2 additions and 15 deletions

View File

@ -37,12 +37,7 @@ abstract class Field_Type {
abstract function render( $itemMetadata );
public function __construct(){
add_action('register_field_types', array(&$this, 'register_field_type'));
}
public function register_field_type(){
global $Tainacan_Fields;
$Tainacan_Fields->register_field_type( $this );
}
public function validate(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) {

View File

@ -194,18 +194,10 @@ class Fields extends TAINACAN_UnitTestCase {
*/
function test_metadata_field_type(){
global $Tainacan_Fields;
$this->assertEquals( 8, sizeof( $Tainacan_Fields->fetch_field_types() ) );
}
/**
* test if the defaults types are registered
*/
function test_metadata_field_type_insert(){
global $Tainacan_Fields;
$class = new RandomType;
$this->assertEquals( 9, sizeof( $Tainacan_Fields->fetch_field_types() ) );
}
/**
*
*/