X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fcontrollers%2Fhelpers%2Fparse_filter.t;h=856ae2e337658ae60931a08aeb7d5fde44e43829;hb=70ba777d43331b446755116b26c04913212d2f1f;hp=c72c33fce83ebb89487f7cbed6cb8f8c2b540359;hpb=c6b2257945060625bcb86fa7e2efd27c737480ff;p=kivitendo-erp.git diff --git a/t/controllers/helpers/parse_filter.t b/t/controllers/helpers/parse_filter.t index c72c33fce..856ae2e33 100644 --- a/t/controllers/helpers/parse_filter.t +++ b/t/controllers/helpers/parse_filter.t @@ -1,6 +1,6 @@ use lib 't'; -use Test::More tests => 23; +use Test::More tests => 28; use Test::Deep; use Data::Dumper; @@ -247,3 +247,49 @@ test { ] ], }, 'object test with prefix but complex value', class => 'SL::DB::Manager::OrderItem'; + +test { + description => 'test' +}, { + query => [ description => 'test' ], + with_objects => [ 'order' ] +}, 'with_objects don\'t get clobbered', with_objects => [ 'order' ]; + +test { + customer => { + description => 'test' + } +}, { + query => [ 'customer.description' => 'test' ], + with_objects => [ 'order', 'customer' ] +}, 'with_objects get extended with auto infered objects', with_objects => [ 'order' ]; + +test { + customer => { + description => 'test' + } +}, { + query => [ 'customer.description' => 'test' ], + with_objects => [ 'order', 'customer' ] +}, 'with_objects get extended with auto infered objects with classes', class => 'SL::DB::Manager::Order', with_objects => [ 'order' ]; + +test { + customer => { + description => 'test' + } +}, { + query => [ 'customer.description' => 'test' ], + with_objects => [ 'customer' ] +}, 'with_objects: no duplicates', with_objects => [ 'customer' ]; + +test { + part => { + 'partnumber:substr::ilike' => '1', + }, +}, { + query => [ + 'part.partnumber', { + ilike => '%1%' + } + ] +}, 'Regression check: prefixing of fallback filtering in relation with custom filters', class => 'SL::DB::Manager::OrderItem';