Set the expected class and the received value.

@param string|object $expected
@param mixed $received
425183
public function setExpectedAndReceived($expected, $received)
    {
        $this->expected = is_string($expected)
            ? $expected : get_class($expected);

        $this->received = TypeHound::fetch($received);

        $this->message = vsprintf(
            'An instance of a %s was expected but got %s',
            [$this->expected, $this->received]
        );
    }
1331451
protected function _transmit($str, $expected = null)
    {
        $this->_writeLine($str);

        $response = $this->_readLine();
        $parts = explode(' ', $response, 2);
        if (count($parts) === 2) {
            list($code, $message) = $parts;
            $message = rtrim($message);
        } else {
            $code = $parts[0];
            $message = null;
        }

        $code = (int)$code;
        if ($expected && !in_array($code, $expected, true)) {
            throw new BadResponseException(['response is not expected: :response', 'response' => $response]);
        }

        return [$code, $message];
    }
140023
protected function processResponse(Response $response, $expectedCode = 200)
	{
		if (202 == $response->code)
		{
			throw new \DomainException(
				'GitHub is building the statistics data. Please try again in a few moments.',
				$response->code
			);
		}

		return parent::processResponse($response, $expectedCode);
	}
974238
private function invalidReturnValue(string $what, string $expected, $actual) : \UnexpectedValueException
    {
        $message = 'Invalid return value from %s: expected %s, got %s.';
        $actual  = is_object($actual) ? get_class($actual) : gettype($actual);

        return new \UnexpectedValueException(sprintf($message, $what, $expected, $actual));
    }
137020
public function seeNumberOfMessagesInQueue($queue, $expected)
    {
        $messageCount = $this->_countMessage($queue);
        $this->assertEquals($expected, $messageCount);
    }
971477
public function send(Message $message, $messageCode, $expectedResponseCode)
    {
        $payload  = $this->encodeMessage($message, $messageCode);
        $stream   = $this->connection->send($payload);

        return $this->receiveMessage($stream, $expectedResponseCode);
    }
222651
public function seeInEmailTextBody($expected)
    {
        $email = $this->fetchLastMessage();
        $this->assertContains($expected, $email->text_body, 'Email body contains text');
    }
171760
public function assertHasHeader(string $expected)
    {
        $actual = $this->getHeaderText();
        if ($expected === $actual) {
            return;
        }

        throw new ExpectationException(
            sprintf(
                '[W402] Expected screen header "%1$s", found "%2$s".',
                $expected,
                $actual
            ),
            $this->getDriver()
        );
    }
243607
public function setExpectedRights($expectedRights)
    {
        
        if (!empty($expectedRights) && preg_match('/^r*w*x*$/', $expectedRights) !== 0) {
            $this->expectedRights = $expectedRights;    
        }
        else{
            throw new common_configuration_MalformedRightsException("Malformed rights. Expected format is r|rw|rwx.");
        }
        
    }
686322
public function setFrom($newFrom)
    {
        $this->from = $newFrom;
        $this->mailFields['from'] = $this->mailFields['reply_to'] = $newFrom;
    }
367645
protected function assertGreaterThanOrEqual($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertGreaterThanOrEqual($expected, $actual, $message);
    }
1141662
protected function write(string $line, $expectedCode = null, string $message = null): void
    {
        \fwrite($this->connection, $line . Message::EOL);
        if ($expectedCode) {
            $response = $this->read();
            if (!\in_array((int) $response, (array) $expectedCode, true)) {
                throw new SmtpException('SMTP server did not accept ' . ($message ?: $line) . ' with error: ' . \trim($response));
            }
        }
    }
816974
public static function match($actual, $expected = null)
    {
        $a = static::actual($actual);
        static::_buildDescription($a, $expected);

        return $a === $expected;
    }
1221129
public function assertLessThanOrEqual($expected, $message = '')
    {
        Assert::assertLessThanOrEqual($expected, $this->getData(), $message);

        return $this;
    }
1265813
public function assertInternalType($expected, $message = '')
    {
        Assert::assertInternalType($expected, $this->getData(), $message);

        return $this;
    }
210634
private function initMethod(object $object, string $method, bool $expected): void
    {
        if (!$this->mustBeInitialized($object, $method)) {
            return;
        }

        $this->object = $object;
        $this->method = $method;
        $this->expected = $expected;
    }
196764
public static function factory($expected, $actual)
    {
        return new self(sprintf(
            'Expected instance of %s. Got %s',
            $expected,
            is_object($actual) ? get_class($actual) : gettype($actual)
        ));
    }