public function testDelete() { $statement = $this->getStatementBuilder(); $statement->delete('people', Condition::equals('id', 1)); $this->assertSame($statement->queries, ['delete from people where id = ?']); $this->assertSame($statement->bindings, [1]); }
public function testEquals() { $condition = Condition::equals('age', 51); $this->assertSame($condition->getLeft(), 'age'); $this->assertFalse($condition->shouldEscapeLeft()); $this->assertSame($condition->getOperator(), '='); $this->assertSame($condition->getRight(), 51); $this->assertTrue($condition->shouldEscapeRight()); }
public function testHasWithNoResults() { $db = $this->buildDatabase(); $condition = Condition::equals('last_name', 'Bob'); $entry = $db->has('presidents', $condition); $this->assertFalse($entry); }
public function testHasSomethingNonExistent() { $db = $this->buildDatabase(); $this->assertFalse($db->has('test', Condition::equals('last_name', 'Lincoln2'))); }