public function run() { parent::run(); if ($this->assertAffectedRows !== null) { if ($this->rows < $this->assertAffectedRows) { throw new TooFewAffectedRowsException("Failed asserting that exactly {$this->assertAffectedRows} rows were affected. The statement affected {$this->rows} rows."); } if ($this->rows > $this->assertAffectedRows) { throw new TooManyAffectedRowsException("Failed asserting that exactly {$this->assertAffectedRows} rows were affected. The statement affected {$this->rows} rows."); } } }
public function run() { parent::run(); $this->mysqli->store_result(); $this->fieldCount = $this->mysqli->field_count; $this->resultingRows = $this->result->num_rows; $this->iteratorPosition = -1; $this->resultSetPosition = -1; $this->resultRows = array(); $this->allFetched = false; if ($this->assertResultingRows !== null) { if ($this->rows < $this->assertResultingRows) { throw new TooFewResultingRowsException("Failed asserting that exactly {$this->assertResultingRows} rows were returned. The statement returned {$this->rows} rows."); } if ($this->rows > $this->assertResultingRows) { throw new TooManyResultingRowsException("Failed asserting that exactly {$this->assertResultingRows} rows were returned. The statement returned {$this->rows} rows."); } } }