ParagonIE\EasyDB\Tests\EasyStatementTest::testGroupingWithAnd PHP Method

testGroupingWithAnd() public method

public testGroupingWithAnd ( )
    public function testGroupingWithAnd()
    {
        $statement = EasyStatement::open()->with('id = ?', 1);
        $group = $statement->group()->with('last_login > ?', 'today')->orWith('last_login IS NULL');
        $this->assertSame($statement, $group->endGroup());
        $this->assertSql($group, 'last_login > ? OR last_login IS NULL');
        $this->assertSql($statement, 'id = ? AND (' . $group->sql() . ')');
        $this->assertValues($statement, [1, 'today']);
    }