X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fcontrollers%2Fhelpers%2Fparse_filter.t;h=554985d92604407c5791060f5a3702a9f9cd9d61;hb=39556a0d83b35291fec9a17cd14762232ae008d7;hp=179c236c9f914f0993e477a55bad5d450f05b14f;hpb=df5d9efd810efd8bd01349d22e3fd4f356cc99ac;p=kivitendo-erp.git diff --git a/t/controllers/helpers/parse_filter.t b/t/controllers/helpers/parse_filter.t index 179c236c9..554985d92 100644 --- a/t/controllers/helpers/parse_filter.t +++ b/t/controllers/helpers/parse_filter.t @@ -16,7 +16,7 @@ sub test ($$$;%) { my ($filter, $expect, $msg, %params) = @_; my $target = delete $params{target}; my $args = { parse_filter($filter, %params) }; - my $got = $args; + my $got = $args; $target ||= ''; $got = $filter if $target =~ /filter/; $got = $params{launder_to} if $target =~ /launder/; cmp_deeply( @@ -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'; +