/** * @covers SphinxSearch\Search::showStatus * @covers SphinxSearch\Search::show */ public function testShowStatus() { $mockShow = $this->mockSql->show(); $mockShow->expects($this->once())->method('show')->with($this->equalTo(Show::SHOW_STATUS)); $mockShow->expects($this->once())->method('like')->with($this->equalTo('up%')); // Assumes prepared statement $this->mockResult->expects($this->at(0))->method('rewind')->will($this->returnValue(true)); $this->mockResult->expects($this->at(1))->method('valid')->will($this->returnValue(true)); $this->mockResult->expects($this->at(2))->method('current')->will($this->returnValue(['Counter' => 'uptime', 'Value' => '1392'])); $this->mockResult->expects($this->at(3))->method('next'); $this->mockResult->expects($this->at(4))->method('valid')->will($this->returnValue(false)); $result = $this->search->showStatus('up%'); $this->assertInternalType('array', $result); $this->assertCount(1, $result); $this->assertArrayHasKey('uptime', $result); $this->assertEquals('1392', $result['uptime']); }
/** * @covers SphinxSearch\Db\Sql\Sql::show */ public function testShow() { $show = $this->sql->show(); $this->assertInstanceOf('\\SphinxSearch\\Db\\Sql\\Show', $show); }