ParagonIE\EasyDB\Tests\QuoteTest::testQuote PHP Method

testQuote() public method

public testQuote ( callable $cb, $quoteThis, array $expectOneOfThese )
$cb callable
$quoteThis
$expectOneOfThese array
    public function testQuote(callable $cb, $quoteThis, array $expectOneOfThese)
    {
        $db = $this->EasyDBExpectedFromCallable($cb);
        $this->assertTrue(count($expectOneOfThese) > 0);
        $matchedOneOfThose = false;
        $quoted = $db->quote((string) $quoteThis);
        foreach ($expectOneOfThese as $expectThis) {
            if ($quoted === $expectThis) {
                $this->assertSame($quoted, $expectThis);
                $matchedOneOfThose = true;
            }
        }
        if (!$matchedOneOfThose) {
            $this->assertTrue(false, 'Did not match ' . $quoted . ' against any of ' . implode('; ', $expectOneOfThese));
        }
    }
QuoteTest