remove uselesss registration and duplicated test
This commit is contained in:
parent
ecd8a22207
commit
483642d4eb
|
@ -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) {
|
||||
|
|
|
@ -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() ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue