/** * @covers Expression::setWhere * @covers Expression::getWhere * @covers Expression::hasWhere * @covers Expression::clearWhere */ public function testWhere() { $this->assertFalse($this->object->hasWhere(), 'Where deveria ser vazio'); $this->assertEquals($this->object, $this->object->setWhere(array('id' => 1)), 'Não retornou o objeto'); $this->assertTrue($this->object->hasWhere(), 'Where não deveria ser vazio'); $this->assertEquals(array(1), $this->object->getWhere()->getParams(), 'Parametro inválido para o where'); $this->object->setWhere(array()); $this->assertFalse($this->object->hasWhere(), 'Where deveria ser vazio novamente'); $where = Where::getInstance(array('id' => 2)); $this->object->setWhere($where); $this->assertEquals($where, $this->object->getWhere()); $this->assertEquals($this->object, $this->object->clearWhere(), 'Não retornou o objeto'); $this->assertFalse($this->object->hasWhere(), 'Where deveria ser vazio novamente'); }