diff --git a/README.md b/README.md index c64598a..f296c40 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,10 @@ This example runs a simple `SELECT` query and dumps all the records from a `book require __DIR__ . '/vendor/autoload.php'; -$mysql = new React\MySQL\MysqlClient('user:pass@localhost/bookstore'); +$mysql = new React\Mysql\MysqlClient('user:pass@localhost/bookstore'); $mysql->query('SELECT * FROM book')->then( - function (React\MySQL\MysqlResult $command) { + function (React\Mysql\MysqlResult $command) { print_r($command->resultFields); print_r($command->resultRows); echo count($command->resultRows) . ' row(s) in set' . PHP_EOL; @@ -68,7 +68,7 @@ The `MysqlClient` is responsible for exchanging messages with your MySQL server and keeps track of pending queries. ```php -$mysql = new React\MySQL\MysqlClient($uri); +$mysql = new React\Mysql\MysqlClient($uri); $mysql->query(…); ``` @@ -114,7 +114,7 @@ The `$uri` parameter must contain the database host, optional authentication, port and database to connect to: ```php -$mysql = new React\MySQL\MysqlClient('user:secret@localhost:3306/database'); +$mysql = new React\Mysql\MysqlClient('user:secret@localhost:3306/database'); ``` Note that both the username and password must be URL-encoded (percent-encoded) @@ -124,7 +124,7 @@ if they contain special characters: $user = 'he:llo'; $pass = 'p@ss'; -$mysql = new React\MySQL\MysqlClient( +$mysql = new React\Mysql\MysqlClient( rawurlencode($user) . ':' . rawurlencode($pass) . '@localhost:3306/db' ); ``` @@ -132,7 +132,7 @@ $mysql = new React\MySQL\MysqlClient( You can omit the port if you're connecting to default port `3306`: ```php -$mysql = new React\MySQL\MysqlClient('user:secret@localhost/database'); +$mysql = new React\Mysql\MysqlClient('user:secret@localhost/database'); ``` If you do not include authentication and/or database, then this method @@ -141,7 +141,7 @@ and no database selected. This may be useful when initially setting up a database, but likely to yield an authentication error in a production system: ```php -$mysql = new React\MySQL\MysqlClient('localhost'); +$mysql = new React\Mysql\MysqlClient('localhost'); ``` This method respects PHP's `default_socket_timeout` setting (default 60s) @@ -150,7 +150,7 @@ successful authentication. You can explicitly pass a custom timeout value in seconds (or use a negative number to not apply a timeout) like this: ```php -$mysql = new React\MySQL\MysqlClient('localhost?timeout=0.5'); +$mysql = new React\Mysql\MysqlClient('localhost?timeout=0.5'); ``` By default, idle connections will be held open for 1ms (0.001s) when not @@ -163,7 +163,7 @@ pass a custom idle timeout value in seconds (or use a negative number to not apply a timeout) like this: ```php -$mysql = new React\MySQL\MysqlClient('localhost?idle=10.0'); +$mysql = new React\Mysql\MysqlClient('localhost?idle=10.0'); ``` By default, the connection provides full UTF-8 support (using the @@ -172,7 +172,7 @@ applications nowadays, but for legacy reasons you can change this to use a different ASCII-compatible charset encoding like this: ```php -$mysql = new React\MySQL\MysqlClient('localhost?charset=utf8mb4'); +$mysql = new React\Mysql\MysqlClient('localhost?charset=utf8mb4'); ``` If you need custom connector settings (DNS resolution, TLS parameters, timeouts, @@ -191,7 +191,7 @@ $connector = new React\Socket\Connector([ ) ]); -$mysql = new React\MySQL\MysqlClient('user:secret@localhost:3306/database', $connector); +$mysql = new React\Mysql\MysqlClient('user:secret@localhost:3306/database', $connector); ``` This class takes an optional `LoopInterface|null $loop` parameter that can be used to @@ -225,7 +225,7 @@ unknown or known to be too large to fit into memory, you should use the [`queryStream()`](#querystream) method instead. ```php -$mysql->query($query)->then(function (React\MySQL\MysqlResult $command) { +$mysql->query($query)->then(function (React\Mysql\MysqlResult $command) { if (isset($command->resultRows)) { // this is a response to a SELECT etc. with some rows (0+) print_r($command->resultFields); diff --git a/composer.json b/composer.json index 7f00983..5b7824c 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ }, "autoload": { "psr-4": { - "React\\MySQL\\": "src/" + "React\\Mysql\\": "src/" } }, "autoload-dev": { "psr-4": { - "React\\Tests\\MySQL\\": "tests/" + "React\\Tests\\Mysql\\": "tests/" } } } diff --git a/examples/01-query.php b/examples/01-query.php index fbf66be..ef40c4b 100644 --- a/examples/01-query.php +++ b/examples/01-query.php @@ -5,10 +5,10 @@ require __DIR__ . '/../vendor/autoload.php'; -$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); +$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); $query = isset($argv[1]) ? $argv[1] : 'select * from book'; -$mysql->query($query)->then(function (React\MySQL\MysqlResult $command) { +$mysql->query($query)->then(function (React\Mysql\MysqlResult $command) { if (isset($command->resultRows)) { // this is a response to a SELECT etc. with some rows (0+) print_r($command->resultFields); diff --git a/examples/02-query-stream.php b/examples/02-query-stream.php index 1562603..b96ed74 100644 --- a/examples/02-query-stream.php +++ b/examples/02-query-stream.php @@ -5,7 +5,7 @@ require __DIR__ . '/../vendor/autoload.php'; -$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); +$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); $query = isset($argv[1]) ? $argv[1] : 'select * from book'; $stream = $mysql->queryStream($query); diff --git a/examples/11-interactive.php b/examples/11-interactive.php index fca5203..dfca10c 100644 --- a/examples/11-interactive.php +++ b/examples/11-interactive.php @@ -5,7 +5,7 @@ require __DIR__ . '/../vendor/autoload.php'; -$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); +$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); // open a STDIN stream to read keyboard input (not supported on Windows) $stdin = new React\Stream\ReadableResourceStream(STDIN); @@ -25,7 +25,7 @@ } $time = microtime(true); - $mysql->query($query)->then(function (React\MySQL\MysqlResult $command) use ($time) { + $mysql->query($query)->then(function (React\Mysql\MysqlResult $command) use ($time) { if (isset($command->resultRows)) { // this is a response to a SELECT etc. with some rows (0+) echo implode("\t", array_column($command->resultFields, 'name')) . PHP_EOL; diff --git a/examples/12-slow-stream.php b/examples/12-slow-stream.php index b61c6f8..bf46e9a 100644 --- a/examples/12-slow-stream.php +++ b/examples/12-slow-stream.php @@ -7,7 +7,7 @@ require __DIR__ . '/../vendor/autoload.php'; -$mysql = new React\MySQL\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); +$mysql = new React\Mysql\MysqlClient(getenv('MYSQL_URI') ?: 'test:test@localhost/test'); $query = isset($argv[1]) ? $argv[1] : 'select * from book'; $stream = $mysql->queryStream($query); @@ -17,7 +17,7 @@ $promise = $ref->getValue($mysql); assert($promise instanceof React\Promise\PromiseInterface); -$promise->then(function (React\MySQL\Io\Connection $connection) { +$promise->then(function (React\Mysql\Io\Connection $connection) { // The protocol parser reads rather large chunks from the underlying connection // and as such can yield multiple (dozens to hundreds) rows from a single data // chunk. We try to artificially limit the stream chunk size here to try to diff --git a/src/Commands/AbstractCommand.php b/src/Commands/AbstractCommand.php index 6f9aaa0..882576b 100644 --- a/src/Commands/AbstractCommand.php +++ b/src/Commands/AbstractCommand.php @@ -1,6 +1,6 @@ * @see self::$charsetNumber - * @see \React\MySQL\Io\Query::$escapeChars + * @see \React\Mysql\Io\Query::$escapeChars */ private static $charsetMap = [ 'latin1' => 8, diff --git a/src/Commands/CommandInterface.php b/src/Commands/CommandInterface.php index 32a82de..310279c 100644 --- a/src/Commands/CommandInterface.php +++ b/src/Commands/CommandInterface.php @@ -1,6 +1,6 @@ - * @see \React\MySQL\Commands\AuthenticateCommand::$charsetMap + * @see \React\Mysql\Commands\AuthenticateCommand::$charsetMap */ private $escapeChars = [ //"\x00" => "\\0", diff --git a/src/Io/QueryStream.php b/src/Io/QueryStream.php index 1b95734..dceb90a 100644 --- a/src/Io/QueryStream.php +++ b/src/Io/QueryStream.php @@ -1,9 +1,9 @@ query($query)->then(function (React\MySQL\MysqlResult $command) { + * $mysql->query($query)->then(function (React\Mysql\MysqlResult $command) { * if (isset($command->resultRows)) { * // this is a response to a SELECT etc. with some rows (0+) * print_r($command->resultFields); diff --git a/src/MysqlResult.php b/src/MysqlResult.php index 86c886c..e0da9af 100644 --- a/src/MysqlResult.php +++ b/src/MysqlResult.php @@ -1,6 +1,6 @@ getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->once())->method('enqueue')->willReturnArgument(0); $conn = new Connection($stream, $executor); @@ -20,7 +20,7 @@ public function testQuitWillEnqueueOneCommand() public function testQueryAfterQuitRejectsImmediately() { $stream = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->once())->method('enqueue')->willReturnArgument(0); $conn = new Connection($stream, $executor); @@ -43,7 +43,7 @@ public function testQueryAfterQuitRejectsImmediately() public function testQueryAfterCloseRejectsImmediately() { $stream = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->never())->method('enqueue'); $conn = new Connection($stream, $executor); @@ -66,7 +66,7 @@ public function testQueryAfterCloseRejectsImmediately() public function testQueryStreamAfterQuitThrows() { $stream = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->once())->method('enqueue')->willReturnArgument(0); $conn = new Connection($stream, $executor); @@ -83,7 +83,7 @@ public function testQueryStreamAfterQuitThrows() public function testPingAfterQuitRejectsImmediately() { $stream = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->once())->method('enqueue')->willReturnArgument(0); $conn = new Connection($stream, $executor); @@ -106,7 +106,7 @@ public function testPingAfterQuitRejectsImmediately() public function testQuitAfterQuitRejectsImmediately() { $stream = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->once())->method('enqueue')->willReturnArgument(0); $conn = new Connection($stream, $executor); @@ -137,7 +137,7 @@ public function testCloseStreamEmitsErrorEvent() return true; })) ); - $executor = $this->getMockBuilder('React\MySQL\Io\Executor')->setMethods(['enqueue'])->getMock(); + $executor = $this->getMockBuilder('React\Mysql\Io\Executor')->setMethods(['enqueue'])->getMock(); $executor->expects($this->never())->method('enqueue'); $conn = new Connection($stream, $executor); diff --git a/tests/Io/FactoryTest.php b/tests/Io/FactoryTest.php index 8757592..6675abd 100644 --- a/tests/Io/FactoryTest.php +++ b/tests/Io/FactoryTest.php @@ -1,13 +1,13 @@ on('error', $this->expectCallableOnceWith($this->isInstanceOf('RuntimeException'))); $stream->on('close', $this->expectCallableOnce()); - $command->emit('error', [new RuntimeException()]); + $command->emit('error', [new \RuntimeException()]); } public function testPauseForwardsToConnectionAfterResultStarted() diff --git a/tests/Io/QueryTest.php b/tests/Io/QueryTest.php index 3a5831f..420c650 100644 --- a/tests/Io/QueryTest.php +++ b/tests/Io/QueryTest.php @@ -1,9 +1,9 @@ getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -93,10 +93,10 @@ public function testPingWillNotCloseConnectionWhenPendingConnectionFails() public function testPingWillNotCloseConnectionWhenUnderlyingConnectionCloses() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -117,10 +117,10 @@ public function testPingWillNotCloseConnectionWhenUnderlyingConnectionCloses() public function testPingWillCancelTimerWithoutClosingConnectionWhenUnderlyingConnectionCloses() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock(); @@ -144,10 +144,10 @@ public function testPingWillCancelTimerWithoutClosingConnectionWhenUnderlyingCon public function testPingWillNotForwardErrorFromUnderlyingConnection() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -167,12 +167,12 @@ public function testPingWillNotForwardErrorFromUnderlyingConnection() public function testPingFollowedByIdleTimerWillQuitUnderlyingConnection() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(\React\Promise\resolve(null)); $base->expects($this->never())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timeout = null; @@ -199,12 +199,12 @@ public function testPingFollowedByIdleTimerWillQuitUnderlyingConnection() public function testPingFollowedByIdleTimerWillCloseUnderlyingConnectionWhenQuitFails() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(\React\Promise\reject(new \RuntimeException())); $base->expects($this->once())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timeout = null; @@ -231,12 +231,12 @@ public function testPingFollowedByIdleTimerWillCloseUnderlyingConnectionWhenQuit public function testPingAfterIdleTimerWillCloseUnderlyingConnectionBeforeCreatingSecondConnection() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'quit', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(new Promise(function () { })); $base->expects($this->once())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->exactly(2))->method('createConnection')->willReturnOnConsecutiveCalls( \React\Promise\resolve($base), new Promise(function () { }) @@ -270,7 +270,7 @@ public function testPingAfterIdleTimerWillCloseUnderlyingConnectionBeforeCreatin public function testQueryReturnsPendingPromiseAndWillNotStartTimerWhenConnectionIsPending() { $deferred = new Deferred(); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -290,10 +290,10 @@ public function testQueryReturnsPendingPromiseAndWillNotStartTimerWhenConnection public function testQueryWillQueryUnderlyingConnectionWhenResolved() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(new Promise(function () { })); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -310,10 +310,10 @@ public function testQueryWillResolveAndStartTimerWithDefaultIntervalWhenQueryFro { $result = new MysqlResult(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(\React\Promise\resolve($result)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -333,10 +333,10 @@ public function testQueryWillResolveAndStartTimerWithIntervalFromIdleParameterWh { $result = new MysqlResult(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(\React\Promise\resolve($result)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -356,10 +356,10 @@ public function testQueryWillResolveWithoutStartingTimerWhenQueryFromUnderlyingC { $result = new MysqlResult(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(\React\Promise\resolve($result)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -380,11 +380,11 @@ public function testQueryBeforePingWillResolveWithoutStartingTimerWhenQueryFromU $result = new MysqlResult(); $deferred = new Deferred(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn($deferred->promise()); $base->expects($this->once())->method('ping')->willReturn(new Promise(function () { })); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -406,11 +406,11 @@ public function testQueryBeforePingWillResolveWithoutStartingTimerWhenQueryFromU public function testQueryAfterPingWillCancelTimerAgainWhenPingFromUnderlyingConnectionResolved() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(new Promise(function () { })); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock(); @@ -432,10 +432,10 @@ public function testQueryWillRejectAndStartTimerWhenQueryFromUnderlyingConnectio { $error = new \RuntimeException(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('query')->with('SELECT 1')->willReturn(\React\Promise\reject($error)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -454,7 +454,7 @@ public function testQueryWillRejectAndStartTimerWhenQueryFromUnderlyingConnectio public function testQueryWillRejectWithoutStartingTimerWhenUnderlyingConnectionRejects() { $deferred = new Deferred(); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -475,7 +475,7 @@ public function testQueryWillRejectWithoutStartingTimerWhenUnderlyingConnectionR public function testQueryStreamReturnsReadableStreamWhenConnectionIsPending() { $promise = new Promise(function () { }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($promise); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -494,10 +494,10 @@ public function testQueryStreamReturnsReadableStreamWhenConnectionIsPending() public function testQueryStreamWillReturnStreamFromUnderlyingConnectionWithoutStartingTimerWhenResolved() { $stream = new ThroughStream(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('queryStream')->with('SELECT 1')->willReturn($stream); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -520,10 +520,10 @@ public function testQueryStreamWillReturnStreamFromUnderlyingConnectionWithoutSt public function testQueryStreamWillReturnStreamFromUnderlyingConnectionAndStartTimerWhenResolvedAndClosed() { $stream = new ThroughStream(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('queryStream')->with('SELECT 1')->willReturn($stream); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -549,7 +549,7 @@ public function testQueryStreamWillReturnStreamFromUnderlyingConnectionAndStartT public function testQueryStreamWillCloseStreamWithErrorWhenUnderlyingConnectionRejects() { $deferred = new Deferred(); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -572,7 +572,7 @@ public function testQueryStreamWillCloseStreamWithErrorWhenUnderlyingConnectionR public function testPingReturnsPendingPromiseWhenConnectionIsPending() { $promise = new Promise(function () { }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($promise); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -590,10 +590,10 @@ public function testPingReturnsPendingPromiseWhenConnectionIsPending() public function testPingWillPingUnderlyingConnectionWhenResolved() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(new Promise(function () { })); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -611,7 +611,7 @@ public function testPingTwiceWillBothRejectWithSameErrorWhenUnderlyingConnection $error = new \RuntimeException(); $deferred = new Deferred(); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -631,7 +631,7 @@ public function testPingWillTryToCreateNewUnderlyingConnectionAfterPreviousPingF { $error = new \RuntimeException(); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->exactly(2))->method('createConnection')->willReturn(\React\Promise\reject($error)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -647,10 +647,10 @@ public function testPingWillTryToCreateNewUnderlyingConnectionAfterPreviousPingF public function testPingWillResolveAndStartTimerWhenPingFromUnderlyingConnectionResolves() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -670,10 +670,10 @@ public function testPingWillRejectAndStartTimerWhenPingFromUnderlyingConnectionR { $error = new \RuntimeException(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\reject($error)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -693,14 +693,14 @@ public function testPingWillRejectAndNotStartIdleTimerWhenPingFromUnderlyingConn { $error = new \RuntimeException(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturnCallback(function () use ($base, $error) { $base->emit('close'); return \React\Promise\reject($error); }); $base->expects($this->never())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -718,7 +718,7 @@ public function testPingWillRejectAndNotStartIdleTimerWhenPingFromUnderlyingConn public function testQuitResolvesAndEmitsCloseImmediatelyWhenConnectionIsNotAlreadyPending() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -740,7 +740,7 @@ public function testQuitResolvesAndEmitsCloseImmediatelyWhenConnectionIsNotAlrea public function testQuitAfterPingReturnsPendingPromiseWhenConnectionIsPending() { $promise = new Promise(function () { }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($promise); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -759,11 +759,11 @@ public function testQuitAfterPingReturnsPendingPromiseWhenConnectionIsPending() public function testQuitAfterPingWillQuitUnderlyingConnectionWhenResolved() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(new Promise(function () { })); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -779,11 +779,11 @@ public function testQuitAfterPingWillQuitUnderlyingConnectionWhenResolved() public function testQuitAfterPingResolvesAndEmitsCloseWhenUnderlyingConnectionQuits() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -805,11 +805,11 @@ public function testQuitAfterPingResolvesAndEmitsCloseWhenUnderlyingConnectionQu public function testQuitAfterPingRejectsAndEmitsCloseWhenUnderlyingConnectionFailsToQuit() { $error = new \RuntimeException(); - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(\React\Promise\reject($error)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -830,7 +830,7 @@ public function testQuitAfterPingRejectsAndEmitsCloseWhenUnderlyingConnectionFai public function testCloseEmitsCloseImmediatelyWhenConnectionIsNotAlreadyPending() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -849,7 +849,7 @@ public function testCloseEmitsCloseImmediatelyWhenConnectionIsNotAlreadyPending( public function testCloseAfterPingCancelsPendingConnection() { $deferred = new Deferred($this->expectCallableOnce()); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($deferred->promise()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -865,11 +865,11 @@ public function testCloseAfterPingCancelsPendingConnection() public function testCloseTwiceAfterPingWillCloseUnderlyingConnectionWhenResolved() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -890,7 +890,7 @@ public function testCloseAfterPingDoesNotEmitConnectionErrorFromAbortedConnectio throw new \RuntimeException(); }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($promise); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -912,10 +912,10 @@ public function testCloseAfterPingDoesNotEmitConnectionErrorFromAbortedConnectio public function testCloseAfterPingWillCancelTimerWhenPingFromUnderlyingConnectionResolves() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock(); @@ -935,13 +935,13 @@ public function testCloseAfterPingWillCancelTimerWhenPingFromUnderlyingConnectio public function testCloseAfterPingHasResolvedWillCloseUnderlyingConnectionWithoutTryingToCancelConnection() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->setMethods(['ping', 'close'])->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('close')->willReturnCallback(function () use ($base) { $base->emit('close'); }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -958,12 +958,12 @@ public function testCloseAfterPingHasResolvedWillCloseUnderlyingConnectionWithou public function testCloseAfterQuitAfterPingWillCloseUnderlyingConnectionWhenQuitIsStillPending() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(new Promise(function () { })); $base->expects($this->once())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -980,12 +980,12 @@ public function testCloseAfterQuitAfterPingWillCloseUnderlyingConnectionWhenQuit public function testCloseAfterPingAfterIdleTimeoutWillCloseUnderlyingConnectionWhenQuitIsStillPending() { - $base = $this->getMockBuilder('React\MySQL\Io\Connection')->disableOriginalConstructor()->getMock(); + $base = $this->getMockBuilder('React\Mysql\Io\Connection')->disableOriginalConstructor()->getMock(); $base->expects($this->once())->method('ping')->willReturn(\React\Promise\resolve(null)); $base->expects($this->once())->method('quit')->willReturn(new Promise(function () { })); $base->expects($this->once())->method('close'); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn(\React\Promise\resolve($base)); $timeout = null; @@ -1013,7 +1013,7 @@ public function testCloseAfterPingAfterIdleTimeoutWillCloseUnderlyingConnectionW public function testCloseTwiceAfterPingEmitsCloseEventOnceWhenConnectionIsPending() { $promise = new Promise(function () { }); - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->once())->method('createConnection')->willReturn($promise); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -1033,7 +1033,7 @@ public function testCloseTwiceAfterPingEmitsCloseEventOnceWhenConnectionIsPendin public function testQueryReturnsRejectedPromiseAfterConnectionIsClosed() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -1052,7 +1052,7 @@ public function testQueryReturnsRejectedPromiseAfterConnectionIsClosed() public function testQueryStreamThrowsAfterConnectionIsClosed() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -1064,13 +1064,13 @@ public function testQueryStreamThrowsAfterConnectionIsClosed() $connection->close(); - $this->setExpectedException('React\MySQL\Exception'); + $this->setExpectedException('React\Mysql\Exception'); $connection->queryStream('SELECT 1'); } public function testPingReturnsRejectedPromiseAfterConnectionIsClosed() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -1089,7 +1089,7 @@ public function testPingReturnsRejectedPromiseAfterConnectionIsClosed() public function testQuitReturnsRejectedPromiseAfterConnectionIsClosed() { - $factory = $this->getMockBuilder('React\MySQL\Io\Factory')->disableOriginalConstructor()->getMock(); + $factory = $this->getMockBuilder('React\Mysql\Io\Factory')->disableOriginalConstructor()->getMock(); $factory->expects($this->never())->method('createConnection'); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); diff --git a/tests/NoResultQueryTest.php b/tests/NoResultQueryTest.php index e129c5c..0789ed8 100644 --- a/tests/NoResultQueryTest.php +++ b/tests/NoResultQueryTest.php @@ -1,10 +1,10 @@