Skip to content

Commit

Permalink
Fixed unit tests to not rely on the existence of any domain or unavai…
Browse files Browse the repository at this point in the history
…lability of internet access when running tests. (#987)
  • Loading branch information
wisskid committed Apr 6, 2024
1 parent 5400b53 commit 34adf4e
Show file tree
Hide file tree
Showing 39 changed files with 453 additions and 553 deletions.
3 changes: 0 additions & 3 deletions src/BlockHandler/TextFormat.php
Expand Up @@ -20,9 +20,6 @@
* - indent_char - string (" ")
* - wrap_boundary - boolean (true)
*
* @link https://www.smarty.net/manual/en/language.function.textformat.php {textformat}
* (Smarty online manual)
*
* @param array $params parameters
* @param string $content contents of the block
* @param Template $template template object
Expand Down
2 changes: 0 additions & 2 deletions src/Compile/Modifier/CatModifierCompiler.php
Expand Up @@ -11,8 +11,6 @@
* Input: string to catenate
* Example: {$var|cat:"foo"}
*
* @link https://www.smarty.net/manual/en/language.modifier.cat.php cat
* (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
2 changes: 0 additions & 2 deletions src/Compile/Modifier/CountCharactersModifierCompiler.php
Expand Up @@ -6,8 +6,6 @@
* Name: count_characters
* Purpose: count the number of characters in a text
*
* @link https://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online
* manual)
* @author Uwe Tews
*/

Expand Down
2 changes: 0 additions & 2 deletions src/Compile/Modifier/CountParagraphsModifierCompiler.php
Expand Up @@ -6,8 +6,6 @@
* Name: count_paragraphs
* Purpose: count the number of paragraphs in a text
*
* @link https://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_paragraphs (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
2 changes: 0 additions & 2 deletions src/Compile/Modifier/CountSentencesModifierCompiler.php
Expand Up @@ -6,8 +6,6 @@
* Name: count_sentences
* Purpose: count the number of sentences in a text
*
* @link https://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_sentences (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/CountWordsModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: count_words
* Purpose: count the number of words in a text
*
* @link https://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/DefaultModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: default
* Purpose: designate default value for empty variables
*
* @link https://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/EscapeModifierCompiler.php
Expand Up @@ -9,7 +9,6 @@
* Name: escape
* Purpose: escape string for output
*
* @link https://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)
* @author Rodney Rehm
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/IndentModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: indent
* Purpose: indent lines of text
*
* @link https://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/LowerModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: lower
* Purpose: convert string to lowercase
*
* @link https://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
*/
Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/Nl2brModifierCompiler.php
Expand Up @@ -7,7 +7,6 @@
* Name: nl2br
* Purpose: insert HTML line breaks before all newlines in a string
*
* @link https://www.smarty.net/docs/en/language.modifier.nl2br.tpl nl2br (Smarty online manual)
*/

class Nl2brModifierCompiler extends Base {
Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/RoundModifierCompiler.php
Expand Up @@ -7,7 +7,6 @@
* Name: round
* Purpose: Returns the rounded value of num to specified precision (number of digits after the decimal point)
*
* @link https://www.smarty.net/docs/en/language.modifier.round.tpl round (Smarty online manual)
*/

class RoundModifierCompiler extends Base {
Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/StrRepeatModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: str_repeat
* Purpose: returns string repeated times times
*
* @link https://www.smarty.net/docs/en/language.modifier.str_repeat.tpl str_repeat (Smarty online manual)
*/

class StrRepeatModifierCompiler extends Base {
Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/StringFormatModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: string_format
* Purpose: format strings via sprintf
*
* @link https://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/StripModifierCompiler.php
Expand Up @@ -9,7 +9,6 @@
* Example: {$var|strip} {$var|strip:"&nbsp;"}
* Date: September 25th, 2002
*
* @link https://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/StripTagsModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: strip_tags
* Purpose: strip html tags from text
*
* @link https://www.smarty.net/docs/en/language.modifier.strip.tags.tpl strip_tags (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/StrlenModifierCompiler.php
Expand Up @@ -7,7 +7,6 @@
* Name: strlen
* Purpose: return the length of the given string
*
* @link https://www.smarty.net/docs/en/language.modifier.strlen.tpl strlen (Smarty online manual)
*/

class StrlenModifierCompiler extends Base {
Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/UpperModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: lower
* Purpose: convert string to uppercase
*
* @link https://www.smarty.net/manual/en/language.modifier.upper.php lower (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
1 change: 0 additions & 1 deletion src/Compile/Modifier/WordWrapModifierCompiler.php
Expand Up @@ -6,7 +6,6 @@
* Name: wordwrap
* Purpose: wrap a string of text at a given length
*
* @link https://www.smarty.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)
* @author Uwe Tews
*/

Expand Down
8 changes: 0 additions & 8 deletions src/Data.php
Expand Up @@ -163,8 +163,6 @@ public function assign($tpl_var, $value = null, $nocache = false, $scope = null)
* be not cached
*
* @return Data
* @link https://www.smarty.net/docs/en/api.append.tpl
*
* @api Smarty::append()
*/
public function append($tpl_var, $value = null, $merge = false, $nocache = false)
Expand Down Expand Up @@ -218,7 +216,6 @@ public function assignGlobal($varName, $value = null, $nocache = false)
*
* @return mixed variable value or or array of variables
* @api Smarty::getTemplateVars()
* @link https://www.smarty.net/docs/en/api.get.template.vars.tpl
*
*/
public function getTemplateVars($varName = null, $searchParents = true)
Expand Down Expand Up @@ -351,7 +348,6 @@ public function getSmarty()
* @param string|array $tpl_var the template variable(s) to clear
*
* @return Data
* @link https://www.smarty.net/docs/en/api.clear.assign.tpl
*
* @api Smarty::clearAssign()
*/
Expand All @@ -371,7 +367,6 @@ public function clearAssign($tpl_var)
* clear all the assigned template variables.
*
* @return Data
* @link https://www.smarty.net/docs/en/api.clear.all.assign.tpl
*
* @api Smarty::clearAllAssign()
*/
Expand All @@ -387,7 +382,6 @@ public function clearAllAssign()
* @param string|null $name variable name or null
*
* @return Data
* @link https://www.smarty.net/docs/en/api.clear.config.tpl
*
* @api Smarty::clearConfig()
*/
Expand Down Expand Up @@ -440,7 +434,6 @@ public function hasConfigVariable($varName): bool {
*
* @return mixed variable value or or array of variables
* @throws Exception
* @link https://www.smarty.net/docs/en/api.get.config.vars.tpl
*
* @api Smarty::getConfigVars()
*/
Expand All @@ -462,7 +455,6 @@ public function getConfigVars($varname = null)
* @returns $this
* @throws \Exception
* @link https://www.smarty.net/docs/en/api.config.load.tpl
*
* @api Smarty::configLoad()
*/
Expand Down
7 changes: 0 additions & 7 deletions src/Extension/DefaultExtension.php
Expand Up @@ -113,7 +113,6 @@ public function getBlockHandler(string $blockTagName): ?\Smarty\BlockHandler\Blo
* Name: spacify
* Purpose: add spaces between characters in a string
*
* @link https://www.smarty.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param string $string input string
Expand Down Expand Up @@ -234,7 +233,6 @@ public function smarty_modifier_count($arrayOrObject, $mode = 0) {
* - format: strftime format for output
* - default_date: default date if $string is empty
*
* @link https://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param string $string input date string
Expand Down Expand Up @@ -386,7 +384,6 @@ public function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $
* Name: escape
* Purpose: escape string for output
*
* @link https://www.smarty.net/docs/en/language.modifier.escape
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param string $string input string
Expand Down Expand Up @@ -654,8 +651,6 @@ public function smarty_modifier_number_format(?float $num, int $decimals = 0, ?s
* Name: regex_replace
* Purpose: regular expression search/replace
*
* @link https://www.smarty.net/manual/en/language.modifier.regex.replace.php
* regex_replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param string $string input string
Expand Down Expand Up @@ -703,7 +698,6 @@ private function regex_replace_check($search)
* Name: replace
* Purpose: simple search/replace
*
* @link https://www.smarty.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
*
Expand All @@ -726,7 +720,6 @@ public function smarty_modifier_replace($string, $search, $replace)
* optionally splitting in the middle of a word, and
* appending the $etc string or inserting $etc into the middle.
*
* @link https://www.smarty.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param string $string input string
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/Counter.php
Expand Up @@ -13,8 +13,6 @@
* @param Template $template template object
*
* @return string|null
*@link https://www.smarty.net/manual/en/language.function.counter.php {counter}
* (Smarty online manual)
*
* @author Monte Ohrt <monte at ohrt dot com>
*/
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/Cycle.php
Expand Up @@ -26,8 +26,6 @@
* {cycle name=row values="one,two,three" reset=true}
* {cycle name=row}
*
* @link https://www.smarty.net/manual/en/language.function.cycle.php {cycle}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author credit to Mark Priatel <mpriatel@rogers.com>
* @author credit to Gerard <gerard@interfold.com>
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/Fetch.php
Expand Up @@ -10,8 +10,6 @@
* Name: fetch
* Purpose: fetch file, web or ftp data and display results
*
* @link https://www.smarty.net/manual/en/language.function.fetch.php {fetch}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param array $params parameters
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlCheckboxes.php
Expand Up @@ -27,8 +27,6 @@
* - assign (optional) - assign the output as an array to this variable
* - escape (optional) - escape the content (not value), defaults to true
*
* @link https://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
* (Smarty online manual)
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlImage.php
Expand Up @@ -20,8 +20,6 @@
* - basedir - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
* - path_prefix - prefix for path output (optional, default empty)
*
* @link https://www.smarty.net/manual/en/language.function.html.image.php {html_image}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Duda <duda@big.hu>
* @version 1.0
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlOptions.php
Expand Up @@ -19,8 +19,6 @@
* - id (optional) - string default not set
* - class (optional) - string default not set
*
* @link https://www.smarty.net/manual/en/language.function.html.options.php {html_image}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>
*
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlRadios.php
Expand Up @@ -27,8 +27,6 @@
* {html_radios values=$ids name='box' separator='<br>' output=$names}
* {html_radios values=$ids checked=$checked separator='<br>' output=$names}
*
* @link https://www.smarty.net/manual/en/language.function.html.radios.php {html_radios}
* (Smarty online manual)
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlSelectDate.php
Expand Up @@ -26,8 +26,6 @@
* - 2.0 complete rewrite for performance,
* added attributes month_names, *_id
*
* @link https://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date}
* (Smarty online manual)
* @version 2.0
* @author Andrei Zmievski
* @author Monte Ohrt <monte at ohrt dot com>
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlSelectTime.php
Expand Up @@ -9,8 +9,6 @@
* Name: html_select_time
* Purpose: Prints the dropdowns for time selection
*
* @link https://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}
* (Smarty online manual)
* @author Roberto Berto <roberto@berto.net>
* @author Monte Ohrt <monte AT ohrt DOT com>
*
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/HtmlTable.php
Expand Up @@ -37,8 +37,6 @@
* @return string
*@author credit to boots <boots dot smarty at yahoo dot com>
* @version 1.1
* @link https://www.smarty.net/manual/en/language.function.html.table.php {html_table}
* (Smarty online manual)
*
* @author Monte Ohrt <monte at ohrt dot com>
* @author credit to Messju Mohr <messju at lammfellpuschen dot de>
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/Mailto.php
Expand Up @@ -35,8 +35,6 @@
* {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
* {mailto address="me@domain.com" extra='class="mailto"'}
*
* @link https://www.smarty.net/manual/en/language.function.mailto.php {mailto}
* (Smarty online manual)
* @version 1.2
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Jason Sweat (added cc, bcc and subject functionality)
Expand Down
2 changes: 0 additions & 2 deletions src/FunctionHandler/Math.php
Expand Up @@ -10,8 +10,6 @@
* Name: math
* Purpose: handle math computations in template
*
* @link https://www.smarty.net/manual/en/language.function.math.php {math}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
*
* @param array $params parameters
Expand Down

0 comments on commit 34adf4e

Please sign in to comment.