Пример #1
0
 /**
  * @covers ::_whereNotExists
  */
 public function testCompileWhereNotExists()
 {
     $compiler = new BaseCompiler();
     $select = new Query();
     $select->setComponent('columns', ['a' => ['columns' => ['id']]]);
     $select->setComponent('from', [new JoinClause('articles')]);
     $where = ['type' => 'Exists', 'query' => $select, 'logic' => 'AND', 'not' => true];
     //$where = new ExistsCond($select);
     $components['where'] = [$where];
     $expected = 'WHERE NOT EXISTS (SELECT `id` FROM `articles`)';
     $result = $compiler->compileWhere($components);
     $this->assertEquals($expected, $result);
 }