コード例 #1
0
 /**
  * @expectedException \BadMethodCallException
  * @expectedExceptionMessage Mocking "expr" is not supported.
  */
 public function testBadMethodCallExceptionIsThrownIfAttemptingToMockUnsupportedMethod()
 {
     $qbm = new QueryBuilderMocker($this);
     $qbm->expr();
 }
コード例 #2
0
 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);
 }