/** * @covers Model::getQuery */ public function testGetQuery() { $q = TestModel::getQuery(array('foo' => 'bar', 'id' => 1, 'limit' => 10)); $con = TestModel::getConnection(); $this->assertSame('test_model', $q->getTable()); foreach ($q->getWhere()->getAnds() as $index => $and) { if ($index === 0) { $this->assertSame($con->quoteIdentifier('id') . ' = 1', $and . ''); } else { $this->fail('There should only be 1 where condition.'); } } $this->assertSame(10, $q->getLimit()); }
public function tearDown() { $this->model->getConnection()->getPdo()->resetQueries(); }