Assert that the given source code is present on the page.

@param  string  $code
@return $this
960406
public function assertSourceHas($code)
    {
        PHPUnit::assertTrue(
            Str::contains($this->driver->getPageSource(), $code),
            "Did not find expected source code [{$code}]"
        );

        return $this;
    }
529869
public function assertResponseCodeIsNot($code) {
        $this->requireResponse();

        try {
            Assertion::notSame(
                $actual = $this->response->getStatusCode(),
                $this->validateResponseCode($code),
                sprintf('Did not expect response code %d.', $actual)
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
154088
public function setStatusCode($code)
    {
        $code = (int) $code;

        if (!array_key_exists($code, $this->validStatusCodes)) {
            throw new Exceptions\InvalidStatusCodeException(
                "'$code' is an invalid status code"
            );
        }

        $this->statusCode = $code;

        return $this;
    }
1246697
public function setCode($code) {
        $this->code = trim($code);
        $this->codeLength = strlen($this->code);
        return $this;
    }
730218
public function withStatus($code = 200)
    {
        if (!array_key_exists($code, self::$responseCodes)) {
            throw new \Exception('That header code '.$code.' is not allowed.');
        }

        $this->code = $code;
        $this->reasonPhrase = self::$responseCodes[$code];

        return $this;
    }
901268
public function withStatus($code, $reasonPhrase = null)
    {
        if ($this->complete) {
            return $this;
        }

        $new = $this->psrResponse->withStatus($code, $reasonPhrase);
        return new self($new);
    }
680560
public function setHttpCode($code)
    {
        $this->addHeader(new Header\Header('HTTP/1.1 ' . (int) $code . ' ' . Header\HttpCode::getText($code), true, (int) $code));

        return $this;
    }
1163523
public function setStatusCode($code)
    {
        $this->headerBag->setStatusCode($code);
        $this->statusCode = $code;

        return $this;
    }
1124881
protected function validateCode($code)
    {
        if (is_integer($code)) {
            return true;
        }

        // Plug it back in and see what we get
        if (is_string($code)) {
            return $this->set($code);
        }

        if (is_array($code)) {
            return $this->validateCodeArray($code);
        }

        return false;
    }
535897
public function code ( $code = NULL ) {
      if ( $code === NULL )
        return $this->code;
      if ( ResponseCode::find( $code ) === NULL )
        throw new \InvalidArgumentException( "Response: no code $code" );
      $this->code = intval( $code );
      return $this;
    }
704048
public function withStatus($code, $reason = '')
    {
        $code = Validator::checkCode($code);

        if (!is_string($reason) && !method_exists($reason, '__toString')) {
            throw new InvalidArgumentException('ReasonPhrase must be a string');
        }

        $clone = clone $this;
        $clone->code = $code;
        if ($reason === '') {
            $reason = Validator::getCodeMessage($code);
        }

        if ($reason === '') {
            throw new InvalidArgumentException('ReasonPhrase must be supplied for this code');
        }

        $clone->phrase = $reason;

        return $clone;
    }
229956
public static function toMessage($code)
    {
        return isset(self::$message[$code]) ? self::$message[$code] : $code;
    }
89010
public function addSource($code): ReflectorBuilder
    {
        $source = SourceCode::fromUnknown($code);

        $this->addLocator(new StringSourceLocator($source));

        return $this;
    }
812088
public function bytecode($bytecode)
    {
        if (HexValidator::validate($bytecode) === false) {
            throw new InvalidArgumentException('Please make sure bytecode is valid.');
        }
        $this->bytecode = Utils::stripZero($bytecode);

        return $this;
    }
751358
public function setStatusCode($code, $text = null)
    {
        $this->statusCode = (int)$code;

        if ($text) {
            $this->statusText = $text;
        } elseif (isset($this->statusTexts[$code])) {
            $this->statusText = $this->statusTexts[$code];
        }

        return $this;
    }
637643
protected function checkEval($code)
    {
        $error = error_get_last();
            
        if (isset($error['message']) 
			&& isset($error['line'])
			&& $error['message'] === 'parse error'
		) {
            $code = explode("\n", $code);
            $start = $error['line'] - 25;
            if ($start < 0) {
                $start = 0;
            }
            
            $code = array_splice($code, $start, 50);
            
            foreach ($code as $i => $line) {
                $code[$i] = (++$start) . ': ' . $line;
            }
            
            Exception::i(self::COMPILE_ERROR)
                ->setType('COMPILE')
                ->addVariable($error['message'])
                ->addVariable($error['line'])
                ->addVariable(implode("\n", $code))
                ->trigger();
        }
        
        return $this;
    }
349361
protected function compare($code, $expectedCode)
    {
        return ($expectedCode !== null && is_string($expectedCode) && $this->niceize($code) == $this->niceize($expectedCode));
    }