manualy set metadata status to publish

This commit is contained in:
Jacson Passold 2017-12-01 00:54:14 -02:00
parent c7394be0b5
commit 185e0dd5ea
2 changed files with 12 additions and 0 deletions

View File

@ -23,9 +23,11 @@ class Items extends \WP_UnitTestCase {
$collection2 = new \Tainacan\Entities\Collection();
$collection->set_name('teste');
$collection->set_status('publish');
$collection->validate();
$collection = $Tainacan_Collections->insert($collection);
$collection2->set_name('teste2');
$collection2->set_status('publish');
$collection2->validate();
$collection2 = $Tainacan_Collections->insert($collection2);
@ -35,14 +37,17 @@ class Items extends \WP_UnitTestCase {
$metadata->set_name('metadado');
$metadata->set_collection( $collection );
$metadata->set_status('publish');
$metadata->validate();
$metadata = $Tainacan_Metadatas->insert($metadata);
$metadata2->set_name('metadado2');
$metadata2->set_collection( $collection2 );
$metadata2->set_status('publish');
$metadata2->validate();
$metadata2 = $Tainacan_Metadatas->insert($metadata2);
$metadata3->set_name('metadado3');
$metadata3->set_collection( $collection2 );
$metadata3->set_status('publish');
$metadata3->validate();
$metadata3 = $Tainacan_Metadatas->insert($metadata3);
@ -52,6 +57,9 @@ class Items extends \WP_UnitTestCase {
$i->set_collection($collection);
$i->add_metadata($metadata, 'value_1');
$i->validate();
/**
* @var \Tainacan\Entities\Item $item
*/
$item = $Tainacan_Items->insert($i);
$item = $Tainacan_Items->fetch($item->get_id());

View File

@ -92,6 +92,7 @@ class Metadata extends \WP_UnitTestCase {
$metadata_default->set_name('metadata default');
$metadata_default->set_collection_id( $Tainacan_Metadatas->get_default_metadata_attribute() );
$metadata_default->set_field_type_object( $type );
$metadata_default->set_status('publish');
$metadata_default->validate();
$Tainacan_Metadatas->insert($metadata_default);
@ -104,6 +105,7 @@ class Metadata extends \WP_UnitTestCase {
$metadata_grandfather->set_name('metadata grandfather');
$metadata_grandfather->set_collection_id( $collection_grandfather->get_id() );
$metadata_grandfather->set_field_type_object( $type );
$metadata_grandfather->set_status('publish');
$metadata_grandfather->validate();
$Tainacan_Metadatas->insert($metadata_grandfather);
@ -119,6 +121,7 @@ class Metadata extends \WP_UnitTestCase {
$metadata_father->set_name('metadata father');
$metadata_father->set_collection_id( $collection_father->get_id() );
$metadata_father->set_field_type_object( $type );
$metadata_father->set_status('publish');
$metadata_father->validate();
$Tainacan_Metadatas->insert($metadata_father);
@ -134,6 +137,7 @@ class Metadata extends \WP_UnitTestCase {
$metadata_son->set_name('metadata son');
$metadata_son->set_collection_id( $collection_son->get_id() );
$metadata_son->set_field_type_object( $type );
$metadata_son->set_status('publish');
$metadata_son->validate();
$Tainacan_Metadatas->insert($metadata_son);