fix tests
This commit is contained in:
parent
887b74b16f
commit
1d868802f9
|
@ -164,7 +164,7 @@ class REST_Controller extends \WP_REST_Controller {
|
|||
foreach ( $request_meta_query as $index1 => $a ) {
|
||||
|
||||
// handle core metadatum
|
||||
if( is_array($a) && array_key_exists("key", $a) && !$request['advancedSearch'] ){
|
||||
if( is_array($a) && array_key_exists("key", $a) && ( !isset($request['advancedSearch']) || !$request['advancedSearch'] ) ){
|
||||
$metadatum = new \Tainacan\Entities\Metadatum($a['key']);
|
||||
if( strpos( $metadatum->get_metadata_type(), 'Core_Title') !== false ){
|
||||
$args[ 'post_title_in' ] = [
|
||||
|
|
|
@ -948,9 +948,9 @@ class BulkEdit extends TAINACAN_UnitApiTestCase {
|
|||
'POST', $this->api_baseroute
|
||||
);
|
||||
|
||||
$request->set_query_params($query);
|
||||
//$request->set_query_params($query);
|
||||
|
||||
$request->set_body( json_encode(['use_query' => 1]) );
|
||||
$request->set_body( json_encode(['use_query' => $query]) );
|
||||
|
||||
$response = $this->server->dispatch($request);
|
||||
|
||||
|
@ -1128,6 +1128,10 @@ class BulkEdit extends TAINACAN_UnitApiTestCase {
|
|||
'items_ids' => $ids,
|
||||
]);
|
||||
|
||||
$this->assertEquals( 0, $bulk->delete_items(), 'Items must be on trash to be deleted' );
|
||||
|
||||
$bulk->trash_items();
|
||||
|
||||
$this->assertEquals( 17, $bulk->delete_items() );
|
||||
|
||||
$Tainacan_Items = \Tainacan\Repositories\Items::get_instance();
|
||||
|
|
Loading…
Reference in New Issue