X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fcontrollers%2Fhelpers%2Fparse_filter.t;h=9d003c0453e55552f0a1d92e49c147e98ea8f303;hb=f8309cb7bc2507c19e17ec59c6c66dd7f49ea351;hp=198877358062b38c289e03034ef3cb96d9630853;hpb=8f0267806367676b2eeebb241734e1e608709ada;p=kivitendo-erp.git diff --git a/t/controllers/helpers/parse_filter.t b/t/controllers/helpers/parse_filter.t index 198877358..9d003c045 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 => 17; +use Test::More tests => 18; use Test::Deep; use Data::Dumper; @@ -58,7 +58,7 @@ test { } }, { query => [ 'customer.chart.accno' => 'test' ], - with_objects => bag( 'customer', 'chart' ), + with_objects => bag( 'customer', 'customer.chart' ), }, 'nested joins'; test { @@ -82,7 +82,7 @@ test { }, { query => [ 'customer.chart.accno' => { like => '%1200' } ], - with_objects => bag('customer', 'chart' ), + with_objects => bag('customer', 'customer.chart' ), }, 'all together'; @@ -100,7 +100,7 @@ test { 'invoice.customer.name' => 'test', 'customer.name' => 'test', }} ], - 'with_objects' => bag( 'invoice', 'customer' ) + 'with_objects' => bag( 'invoice.customer', 'customer', 'invoice' ) }, 'object in more than one relationship'; test { @@ -177,3 +177,16 @@ test { } }, 'deep laundering, check for laundered hash', target => 'launder', launder_to => { }; +### bug: sub objects + +test { + order => { + customer => { + 'name:substr::ilike' => 'test', + } + } +}, { + query => [ 'order.customer.name' => { ilike => '%test%' } ], + with_objects => bag('order.customer', 'order'), +}, 'sub objects have to retain their prefix'; +