public function contains($to, TableNode $values)
    {
        $rows = $values->getRowsHash();

        foreach ($this->getEmailMessages($to) as $message) {
            foreach ($rows as $field => $value) {
                if (empty($message[$field])) {
                    throw new \InvalidArgumentException(sprintf('Message does not contain "%s" header.', $field));
                }

                if (strpos($message[$field], $value) === false) {
                    throw new \RuntimeException(sprintf('Value of "%s" does not contain "%s".', $field, $value));
                }
            }
        }
    }
public function contains($to, TableNode $values)
    {
        $rows = $values->getRowsHash();

        foreach ($this->getEmailMessages($to) as $message) {
            foreach ($rows as $field => $value) {
                if (empty($message[$field])) {
                    throw new \InvalidArgumentException(sprintf('Message does not contain "%s" header.', $field));
                }

                if (strpos($message[$field], $value) === false) {
                    throw new \RuntimeException(sprintf('Value of "%s" does not contain "%s".', $field, $value));
                }
            }
        }
    }
@example
I check that email for "test@example.com" contains:
| subject | New email letter   |
| body    | The body of letter |
I also check that email contains:
| from    | admin@example.com  |

@param string $to
Recipient.
@param TableNode $values
Left column - is a header key, right - value.

@throws \RuntimeException
When any message was not sent.
@throws \InvalidArgumentException
@throws \RuntimeException

@Given /^(?:|I )check that email for "([^"]*)" contains:$/