-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from lucee/test-ldev1004
LDEV-1004 test case
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
component extends="org.lucee.cfml.test.LuceeTestCase" labels="pdf" skip="true"{ | ||
function run( testResults, testBox ) { | ||
describe("Testcase for LDEV-1004", function() { | ||
it( title="check placeholders are resolved", body=function( currentSpec ) { | ||
|
||
local.result = _internalRequest( | ||
template : "#createURI("LDEV1004")#/placeholders.cfm" | ||
); | ||
local.pdf=local.result.filecontent_binary; | ||
expect( isPDFObject( pdf ) ).toBeTrue(); | ||
|
||
pdf action="extracttext" source="#pdf#" name="local.extractedText"; | ||
|
||
expect( extractedText ).notToInclude("currentPageNumber", "placeholder [currentPageNumber] should be resolved"); | ||
expect( extractedText ).notToInclude("totalPageCount", "placeholder [currentPageNumber] should be resolved"); | ||
expect( extractedText ).notToInclude("totalSectionPageCount", "placeholder [totalSectionPageCount] should be resolved"); | ||
expect( extractedText ).notToInclude("currentSectionPageNumber", "placeholder [currentSectionPageNumber] should be resolved"); | ||
|
||
}); | ||
}); | ||
} | ||
|
||
private string function createURI(string calledName){ | ||
|
||
var baseURI = getDirectoryFromPath( contractPath( getCurrentTemplatePath() ) ); | ||
return baseURI&""&calledName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!--- https://dev.lucee.org/t/cfdocument-error-on-total-page-count/2102 ---> | ||
<cfdocument format="pdf"> | ||
<cfdocumentitem type="header" evalatprint="false"> | ||
<table width="100%" border="0" cellpadding="0" cellspacing="0"> | ||
<strong><tr><td align="right"><cfoutput>#cfdocument.currentSectionPageNumber# of</strong> | ||
<strong>#cfdocument.totalSectionPageCount#</cfoutput></td></tr></strong> | ||
</table> | ||
</cfdocumentitem> | ||
|
||
<cfdocumentitem type="footer" evalatprint="true"> | ||
<table width="100%" border="0" cellpadding="0" cellspacing="0"> | ||
<strong><tr><td align="center"><cfoutput>#cfdocument.currentPageNumber# of</strong> | ||
<strong>#cfdocument.totalPageCount#</cfoutput></td></tr></strong> | ||
</table> | ||
</cfdocumentitem> | ||
|
||
<cfdocumentsection> | ||
<h1>Section 1</h1> | ||
<cfloop from=1 to=5 index="i"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p> | ||
</cfloop> | ||
</cfdocumentsection> | ||
|
||
<cfdocumentsection> | ||
<h1>Section 2</h1> | ||
<cfloop from=1 to=5 index="i"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p> | ||
</cfloop> | ||
</cfdocumentsection> | ||
|
||
<cfdocumentsection> | ||
<h1>Section 3</h1> | ||
<cfloop from=1 to=5 index="i"> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p> | ||
</cfloop> | ||
</cfdocumentsection> | ||
</cfdocument> |