/** * @expectedException \Repo2\QueryReactor\Driver\Mysqli\MysqliException * @expectedExceptionMessage MySQL server has gone away */ public function testFailedQuery() { $params = TestUtil::getControllerParams(); $driver = $this->getDriver(); $link = $driver->connect($params, $params['username'], $params['passwd']); /* @var $link \mysqli */ $processid = $link->thread_id; $link->kill($processid); $expr = $this->getMock('\\Repo2\\QueryBuilder\\ExpressionInterface'); $expr->expects($this->once())->method('compile')->will($this->returnValue('SELECT 1')); $driver->query($link, $expr); }
/** * @expectedException \OutOfBoundsException * @expectedExceptionMessageRegExp /Undefined .+ in the sharding controller/ */ public function testErrorOnUndefinedLink() { $sharding = $this->getShardingMock(); $driver = TestUtil::getDriver(); $params = TestUtil::getControllerParams(); $link = $driver->connect($params, $params['username'], $params['passwd']); $controller = $this->createShardingController($sharding); $controller->getQuery($driver, $link); }
public function setUp() { $this->reactor = $this->createReactor($this->createController(TestUtil::getControllerParams())); $this->queryAwait(new Query\GenericQuery(Fixtures::getCreateTable())); }