mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-13 10:52:15 +01:00
4.0.0 (#42)
* adding URL conversions * updating gotenberg version in documentation * pkg: input as variadic string (#39) * pkg: input as variadic string * pkg: fix link to github doc * update doc about v4 client * make doc * fixing missing variadic inputs in doc * adding more fonts * updating PHP documentation
This commit is contained in:
15
test/testdata/url/footer.html
vendored
Normal file
15
test/testdata/url/footer.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-size: 8rem;
|
||||
margin: 4rem auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<span class="pageNumber"></span> of <span class="totalPages"></span>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
13
test/testdata/url/header.html
vendored
Normal file
13
test/testdata/url/header.html
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-size: 8rem;
|
||||
margin: 4rem auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span class="title"></span>
|
||||
</body>
|
||||
</html>
|
||||
@@ -23,6 +23,13 @@ func HTMLTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||
return multipartForm(t, "html")
|
||||
}
|
||||
|
||||
// URLTestMultipartForm returns the body
|
||||
// for a multipate/form-data request with all
|
||||
// files under "url" folder.
|
||||
func URLTestMultipartForm(t *testing.T) (*bytes.Buffer, string) {
|
||||
return multipartForm(t, "url")
|
||||
}
|
||||
|
||||
// MarkdownTestMultipartForm returns the body
|
||||
// for a multipate/form-data request with all
|
||||
// files under "markdown" folder.
|
||||
@@ -65,6 +72,10 @@ func multipartForm(t *testing.T, kind string) (*bytes.Buffer, string) {
|
||||
_, err = io.Copy(part, file)
|
||||
require.Nil(t, err)
|
||||
}
|
||||
if kind == "url" {
|
||||
err := writer.WriteField("remoteURL", "http://google.com")
|
||||
require.Nil(t, err)
|
||||
}
|
||||
return body, writer.FormDataContentType()
|
||||
}
|
||||
|
||||
@@ -74,6 +85,12 @@ func HTMLTestDirPath(t *testing.T) string {
|
||||
return copyDir(t, "html")
|
||||
}
|
||||
|
||||
// URLTestDirPath creates a copy
|
||||
// of "url" folder in test/testdata.
|
||||
func URLTestDirPath(t *testing.T) string {
|
||||
return copyDir(t, "url")
|
||||
}
|
||||
|
||||
// MarkdownTestDirPath creates a copy
|
||||
// of "markdown" folder in test/testdata.
|
||||
func MarkdownTestDirPath(t *testing.T) string {
|
||||
@@ -127,6 +144,12 @@ func HTMLTestFilePath(t *testing.T, filename string) string {
|
||||
return abs(t, "html", filename)
|
||||
}
|
||||
|
||||
// URLTestFilePath returns the absolute file path
|
||||
// of a file in "url" folder in test/testdata.
|
||||
func URLTestFilePath(t *testing.T, filename string) string {
|
||||
return abs(t, "url", filename)
|
||||
}
|
||||
|
||||
// MarkdownTestFilePath returns the absolute file path
|
||||
// of a file in "markdown" folder in test/testdata.
|
||||
func MarkdownTestFilePath(t *testing.T, filename string) string {
|
||||
|
||||
Reference in New Issue
Block a user