public function testCompileIsNull() { $c = new BaseCompiler(); $where = ['type' => 'Null', 'table' => '', 'cols' => ['author_id'], 'val' => null, 'logic' => 'AND', 'not' => false]; //$where = new SimpleCond('a', 'author_id', '=', 12); $components['where'] = array($where); $expected = 'WHERE `author_id` IS NULL'; $result = $c->compileWhere($components); $this->assertEquals($expected, $result); $where = ['type' => 'Null', 'table' => '', 'cols' => ['author_id'], 'val' => null, 'logic' => 'AND', 'not' => true]; //$where = new SimpleCond('a', 'author_id', '=', 12); //$where = new SimpleCond('a', 'author_id', '=', 12); $components['where'] = array($where); $expected = 'WHERE `author_id` IS NOT NULL'; $result = $c->compileWhere($components); $this->assertEquals($expected, $result); }