/** * @group unit */ public function testEnabledDisable() { $connection = new Connection(); $this->assertTrue($connection->isEnabled()); $connection->setEnabled(false); $this->assertFalse($connection->isEnabled()); $connection->setEnabled(true); $this->assertTrue($connection->isEnabled()); }
/** * @param \Elastica\Connection $connection * @param \Exception $e * @param Client $client */ public function onFail(Connection $connection, Exception $e, Client $client) { $connection->setEnabled(false); if ($this->_callback) { call_user_func($this->_callback, $connection, $e, $client); } }