public function testConstructorWithFieldsAndBoosts() { $fields = array('id' => 1, 'name' => 'testname'); $boosts = array('name' => 2.7); $doc = new Solarium_Document_ReadWrite($fields, $boosts); $this->assertEquals($fields, $doc->getFields()); $this->assertEquals(2.7, $doc->getFieldBoost('name')); }
/** * (non-PHPdoc) * @see Solarium_Document_ReadOnly::getFields() */ public function getFields() { if ($this->key == null || !isset($this->_fields[$this->key])) { throw new Exception('Solarium_Document_AtomicUpdate must have a unique-ID\'d key registered before it can be used to build update commands'); } return parent::getFields(); }