/** * @expectedException \BadMethodCallException * @expectedExceptionMessage Mocking "expr" is not supported. */ public function testBadMethodCallExceptionIsThrownIfAttemptingToMockUnsupportedMethod() { $qbm = new QueryBuilderMocker($this); $qbm->expr(); }
public function testExprWorksProperlyWhenUsedInsideWhere() { $qbm = new QueryBuilderMocker($this); $qbm->andWhere($qbm->expr()->isNull('foo')); $qb = $qbm->getQueryBuilderMock(); $expression = $qb->expr()->isNull('foo'); $this->assertEquals('foo IS NULL', $expression); $qb->andWhere($expression); }