diff --git a/tests/test-api-items.php b/tests/test-api-items.php index 8c83cb29f..a6c8dcffb 100644 --- a/tests/test-api-items.php +++ b/tests/test-api-items.php @@ -380,7 +380,7 @@ class TAINACAN_REST_Items_Controller extends TAINACAN_UnitApiTestCase { $data = $response->get_data()['items']; $this->assertEquals( 2, sizeof($data) ); - $this->assertEquals( 5, sizeof($data[0]['metadata']) ); + $this->assertEquals( 7, sizeof($data[0]['metadata']) ); // Fetch only as admin $request = new \WP_REST_Request( diff --git a/tests/test-api-metadata.php b/tests/test-api-metadata.php index 06525444c..e694eb453 100644 --- a/tests/test-api-metadata.php +++ b/tests/test-api-metadata.php @@ -764,10 +764,12 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase { $response = $this->server->dispatch($requestC); $data = $response->get_data(); - $this->assertEquals(3, count($data)); + $this->assertEquals(5, count($data)); $this->assertNotEquals($metadatumB->get_id(), $data[0]['id']); $this->assertNotEquals($metadatumB->get_id(), $data[1]['id']); $this->assertNotEquals($metadatumB->get_id(), $data[2]['id']); + $this->assertNotEquals($metadatumB->get_id(), $data[3]['id']); + $this->assertNotEquals($metadatumB->get_id(), $data[4]['id']); } public function test_private_meta_ids_not_in_metadata_order(){ @@ -825,7 +827,7 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase { $response = $this->server->dispatch($request); $data = $response->get_data(); - $this->assertEquals(4, count($data['metadata_order'])); + $this->assertEquals(6, count($data['metadata_order'])); wp_logout(); wp_set_current_user(0); @@ -835,11 +837,12 @@ class TAINACAN_REST_Metadata_Controller extends TAINACAN_UnitApiTestCase { $response = $this->server->dispatch($request); $data = $response->get_data(); - $this->assertEquals(3, count($data['metadata_order'])); + $this->assertEquals(5, count($data['metadata_order'])); $this->assertNotEquals($metadatumB->get_id(), $data['metadata_order'][0]['id']); $this->assertNotEquals($metadatumB->get_id(), $data['metadata_order'][1]['id']); $this->assertNotEquals($metadatumB->get_id(), $data['metadata_order'][2]['id']); - + $this->assertNotEquals($metadatumB->get_id(), $data['metadata_order'][3]['id']); + $this->assertNotEquals($metadatumB->get_id(), $data['metadata_order'][4]['id']); } /** diff --git a/tests/test-capabilities.php b/tests/test-capabilities.php index 0c38b8d5a..d01266336 100644 --- a/tests/test-capabilities.php +++ b/tests/test-capabilities.php @@ -502,25 +502,25 @@ class Capabilities extends TAINACAN_UnitTestCase { wp_set_current_user($this->subscriber2->ID); $meta = tainacan_metadata()->fetch_by_collection($this->public_collection); - $this->AssertEquals(4, sizeof($meta)); + $this->AssertEquals(6, sizeof($meta)); $meta = tainacan_metadata()->fetch_ids_by_collection($this->public_collection); - $this->AssertEquals(4, sizeof($meta)); + $this->AssertEquals(6, sizeof($meta)); $this->subscriber2->add_cap( 'tnc_col_' . $this->public_collection->get_id() . '_read_private_metadata' ); $current_user = $this->subscriber2; // force update current user object with new capabilities $meta = tainacan_metadata()->fetch_by_collection($this->public_collection); - $this->AssertEquals(5, sizeof($meta)); + $this->AssertEquals(7, sizeof($meta)); $meta = tainacan_metadata()->fetch_ids_by_collection($this->public_collection); - $this->AssertEquals(5, sizeof($meta)); + $this->AssertEquals(7, sizeof($meta)); $this->subscriber2->add_cap( 'tnc_rep_read_private_metadata' ); $current_user = $this->subscriber2; // force update current user object with new capabilities $meta = tainacan_metadata()->fetch_by_collection($this->public_collection); - $this->AssertEquals(6, sizeof($meta)); + $this->AssertEquals(8, sizeof($meta)); $meta = tainacan_metadata()->fetch_ids_by_collection($this->public_collection); - $this->AssertEquals(6, sizeof($meta)); + $this->AssertEquals(8, sizeof($meta)); } diff --git a/tests/test-item-metadata.php b/tests/test-item-metadata.php index 9badf85e3..1292189ea 100644 --- a/tests/test-item-metadata.php +++ b/tests/test-item-metadata.php @@ -240,7 +240,7 @@ class Item_Metadata extends TAINACAN_UnitTestCase { $this->assertTrue(is_array($item_metadatas)); // notice for repository metadata - $this->assertEquals(3, sizeof($item_metadatas)); + $this->assertEquals(5, sizeof($item_metadatas)); //first 2 metadata are repository metadata $this->assertTrue( in_array('metadado', $names) ); diff --git a/tests/test-metadata.php b/tests/test-metadata.php index 43a47d73b..4bc42f8bd 100644 --- a/tests/test-metadata.php +++ b/tests/test-metadata.php @@ -165,8 +165,8 @@ class Metadata extends TAINACAN_UnitTestCase { $retrieve_metadata_ids = $Tainacan_Metadata->fetch_ids_by_collection( $collection_son, [] ); // should return 6 - $this->assertEquals( 6, sizeof( $retrieve_metadata ) ); - $this->assertEquals( 6, sizeof( $retrieve_metadata_ids ) ); + $this->assertEquals( 8, sizeof( $retrieve_metadata ) ); + $this->assertEquals( 8, sizeof( $retrieve_metadata_ids ) ); } /** @@ -197,7 +197,7 @@ class Metadata extends TAINACAN_UnitTestCase { */ function test_metadata_metadata_type(){ $Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance(); - $this->assertEquals( 9, sizeof( $Tainacan_Metadata->fetch_metadata_types() ) ); + $this->assertEquals( 10, sizeof( $Tainacan_Metadata->fetch_metadata_types() ) ); }