Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit f88d8e0

Browse files
committed
test coverage for calling filters with arguments
* this tests calling a filter that has arguments when providing over loaded arguments and not assigning arguments and accepting the defaults
1 parent 8216136 commit f88d8e0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/index.cfm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<cfelse>
1616

17-
<cfset test = createObject("component", "cfml-liquid.tests.tests.DropTest")>
18-
<cfset test.runTest("test", "test_haskey_should_return_false_if_method_does_not_exists")>
17+
<cfset test = createObject("component", "cfml-liquid.tests.tests.OutputTest")>
18+
<cfset test.runTest("test", "test_filter_with_default_arguments")>
1919

2020
</cfif>
2121

tests/tests/OutputTest.cfc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,16 @@
7575
<cfset assert_template_result(loc.e, loc.t, loc.template, loc.a)>
7676
</cffunction>
7777

78+
<cffunction name="test_filter_with_overloaded_arguments">
79+
<cfset loc.t = " {{ car.gm | add_tag : 'span', 'bar', 'foo', 'bas'}} ">
80+
<cfset loc.e = " <span id=""bar"">bad</span> ">
81+
<cfset assert_template_result(loc.e, loc.t, loc.template, loc.a)>
82+
</cffunction>
83+
84+
<cffunction name="test_filter_with_default_arguments">
85+
<cfset loc.t = " {{ car.gm | add_tag }} ">
86+
<cfset loc.e = " <p id=""foo"">bad</p> ">
87+
<cfset assert_template_result(loc.e, loc.t, loc.template, loc.a)>
88+
</cffunction>
89+
7890
</cfcomponent>

0 commit comments

Comments
 (0)