Assert partial output

@param string $expected
@param string $actual
15035
public function assertNotPartialOutput($expected, $type = 'stdout')
    {
        $expected = (string) $expected;
        $actual = $this->getOutputByType($type);

        if (false !== strpos($actual, $expected)) {
            throw new ExpectationException("Failed to assert \"$actual\" does not contain \"$expected\"");
        }
    }
700409
function(actual) {
      function assert(matcher, args, negate) {
        var expected = toArray(args, 1)
        matcher.negate = negate  
        assertion = new JSpec.Assertion(matcher, actual, expected, negate)
        hook('beforeAssertion', assertion)
        if (matcher.defer) assertion.run()
        else JSpec.currentSpec.assertions.push(assertion.run().report()), hook('afterAssertion', assertion)
        return assertion.result
      }
      
      function to(matcher) {
        return assert(matcher, arguments, false)
      }
      
      function not_to(matcher) {
        return assert(matcher, arguments, true)
      }
      
      return {
        to : to,
        should : to,
        not_to: not_to,
        should_not : not_to
      }
    }
153205
public static function assertBool($actual, string $message = '')
    {
        self::assertTypeOfScalar($actual, $message, 'assertBool', new ScalarConstraint(ScalarConstraint::TYPE_BOOL));
    }
728848
static public void assertEquals(String message, boolean expected, boolean actual) {
        assertEquals(message, Boolean.valueOf(expected), Boolean.valueOf(actual));
    }
700036
static public void assertEquals(String message, String expected, String actual) {
        if (expected == null && actual == null) {
            return;
        }
        if (expected != null && expected.equals(actual)) {
            return;
        }
        String cleanMessage = message == null ? "" : message;
        throw new ComparisonFailure(cleanMessage, expected, actual);
    }
945568
function assertOut(key, expected, result) {
  var actual = result[key];
  var statement = expected instanceof RegExp
    ? expected.test(actual)
    : expected === actual;

  if (statement !== true) {
    var message = 'Expected ' + key +' to match "' + expected + '". Actual: "' + actual + '"';
    return error(result, message, expected, actual);
  }
}
922812
public static function _buildDescription($actual, $expected, $precision)
    {
        $description = "be close to expected relying to a precision of {$precision}.";
        $data['actual'] = $actual;
        $data['expected'] = $expected;
        $data['gap is >='] = pow(10, -$precision) / 2;
        static::$_description = compact('description', 'data');
    }
299006
public static function invalidEntityType($expected, $actual)
    {
        return new self(sprintf(
            'Entity must be an instance of "%s"; got "%s".',
            $expected,
            is_object($actual) ? get_class($actual) : gettype($actual)
        ));
    }
348472
private static function hash_equals($expected, $actual) {

        $expected = (string) $expected;
        $actual   = (string) $actual;
        
        if(true === function_exists('hash_equals')) {
            return hash_equals($expected, $actual);
        }

        $lenExpected  = mb_strlen($expected, self :: ENCODING);
        $lenActual    = mb_strlen($actual, self :: ENCODING);
        $len          = min($lenExpected, $lenActual);
        $result       = 0;
        
        for ($i = 0; $i < $len; $i++) {
            $result |= ord($expected[$i]) ^ ord($actual[$i]);
        }

        $result |= $lenExpected ^ $lenActual;

        return ($result === 0);
    }
757267
protected function assertMailCount($actualMail, $expectedCount = null)
    {
        $actualCount = count($actualMail);
        if (is_null($expectedCount)) {
            // If number to expect is not specified, expect more than zero.
            if ($actualCount === 0) {
                throw new \Exception("Expected some mail, but none found.");
            }
        } else {
            if ($expectedCount != $actualCount) {
                // Prepare a simple list of actual mail.
                $prettyActualMail = [];
                foreach ($actualMail as $singleActualMail) {
                    $prettyActualMail[] = [
                    'to' => $singleActualMail['to'],
                    'subject' => $singleActualMail['subject'],
                    ];
                }
                throw new \Exception(sprintf("Expected %s mail, but %s found:\n\n%s", $expectedCount, $actualCount, print_r($prettyActualMail, true)));
            }
        }
    }
110872
public static function match($actual, $expected)
    {
        if (is_string($actual)) {
            return strpos($actual, $expected) !== false;
        } elseif (is_array($actual) || $actual instanceof Traversable) {
            foreach ($actual as $key => $value) {
                if ($value === $expected) {
                    return true;
                }
            }
        }
        return false;
    }
905531
public function compareString($expected,$actual)
	{
		$expected.="\0";
		$actual.="\0";
		$expectedLength=$this->strlen($expected);
		$actualLength=$this->strlen($actual);
		$diff=$expectedLength-$actualLength;
		for($i=0;$i<$actualLength;$i++)
			$diff|=(ord($actual[$i])^ord($expected[$i%$expectedLength]));
		return $diff===0;
	}
658186
public function match($actual)
    {
        $this->actual = gettype($actual);

        return ($this->actual === $this->expected);
    }
1027208
public static function throwIfNot($actualObject, string $expectedType, bool $allowNull = false): void
    {
        if (!is_a($expectedType, $expectedType, true)) {
            if (\gettype($actualObject) !== $expectedType) {
                if (null === $actualObject && $allowNull) {
                    return;
                }
                throw new self($expectedType, $actualObject);
            }
            return;
        }

        if (!$actualObject instanceof $expectedType) {
            if (null === $actualObject && $allowNull) {
                return;
            }
            throw new self($expectedType, $actualObject);
        }
    }
968004
static function isArraySame($expected, $actual) {

		if (Arrays::isNumeric($actual) and Arrays::isNumeric($expected)) {
			sort($expected);
			sort($actual);
		} else {
			asort($expected);
			asort($actual);
		}
		
		return $expected === $actual;
	}
395603
public void assertEquals(Object expected, Object actual) {
    if (expected == null && actual == null)
      return;
    if (expected != null && expected.equals(actual))
      return;
    fail(format(expected, actual));
  }
480531
public static function _buildDescription($actual, $expected)
    {
        $description = "have the expected type.";
        $data['actual'] = $actual;
        $data['expected'] = $expected;
        static::$_description = compact('description', 'data');
    }