mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Fixed travis.
This commit is contained in:
parent
f85ed582ee
commit
4b316b5903
@ -13,8 +13,8 @@ declare(strict_types=1);
|
|||||||
namespace HyperfTest\DbConnection;
|
namespace HyperfTest\DbConnection;
|
||||||
|
|
||||||
use Hyperf\Contract\ConfigInterface;
|
use Hyperf\Contract\ConfigInterface;
|
||||||
|
use Hyperf\Database\ConnectionResolverInterface;
|
||||||
use Hyperf\DbConnection\Connection;
|
use Hyperf\DbConnection\Connection;
|
||||||
use Hyperf\DbConnection\ConnectionResolver;
|
|
||||||
use Hyperf\DbConnection\Pool\PoolFactory;
|
use Hyperf\DbConnection\Pool\PoolFactory;
|
||||||
use Hyperf\Utils\Context;
|
use Hyperf\Utils\Context;
|
||||||
use HyperfTest\DbConnection\Stubs\ConnectionStub;
|
use HyperfTest\DbConnection\Stubs\ConnectionStub;
|
||||||
@ -39,7 +39,7 @@ class ConnectionTest extends TestCase
|
|||||||
{
|
{
|
||||||
$container = ContainerStub::mockContainer();
|
$container = ContainerStub::mockContainer();
|
||||||
|
|
||||||
$resolver = $container->get(ConnectionResolver::class);
|
$resolver = $container->get(ConnectionResolverInterface::class);
|
||||||
|
|
||||||
$connection = $resolver->connection();
|
$connection = $resolver->connection();
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class ConnectionTest extends TestCase
|
|||||||
{
|
{
|
||||||
$container = ContainerStub::mockContainer();
|
$container = ContainerStub::mockContainer();
|
||||||
|
|
||||||
$resolver = $container->get(ConnectionResolver::class);
|
$resolver = $container->get(ConnectionResolverInterface::class);
|
||||||
|
|
||||||
/** @var \Hyperf\Database\Connection $connection */
|
/** @var \Hyperf\Database\Connection $connection */
|
||||||
$connection = $resolver->connection();
|
$connection = $resolver->connection();
|
||||||
@ -95,7 +95,7 @@ class ConnectionTest extends TestCase
|
|||||||
{
|
{
|
||||||
$container = ContainerStub::mockReadWriteContainer();
|
$container = ContainerStub::mockReadWriteContainer();
|
||||||
|
|
||||||
$resolver = $container->get(ConnectionResolver::class);
|
$resolver = $container->get(ConnectionResolverInterface::class);
|
||||||
|
|
||||||
/** @var \Hyperf\Database\Connection $connection */
|
/** @var \Hyperf\Database\Connection $connection */
|
||||||
$connection = $resolver->connection();
|
$connection = $resolver->connection();
|
||||||
@ -112,7 +112,7 @@ class ConnectionTest extends TestCase
|
|||||||
$container = ContainerStub::mockReadWriteContainer();
|
$container = ContainerStub::mockReadWriteContainer();
|
||||||
|
|
||||||
parallel([function () use ($container) {
|
parallel([function () use ($container) {
|
||||||
$resolver = $container->get(ConnectionResolver::class);
|
$resolver = $container->get(ConnectionResolverInterface::class);
|
||||||
|
|
||||||
/** @var \Hyperf\Database\Connection $connection */
|
/** @var \Hyperf\Database\Connection $connection */
|
||||||
$connection = $resolver->connection();
|
$connection = $resolver->connection();
|
||||||
@ -126,7 +126,7 @@ class ConnectionTest extends TestCase
|
|||||||
}]);
|
}]);
|
||||||
|
|
||||||
parallel([function () use ($container) {
|
parallel([function () use ($container) {
|
||||||
$resolver = $container->get(ConnectionResolver::class);
|
$resolver = $container->get(ConnectionResolverInterface::class);
|
||||||
|
|
||||||
/** @var \Hyperf\Database\Connection $connection */
|
/** @var \Hyperf\Database\Connection $connection */
|
||||||
$connection = $resolver->connection();
|
$connection = $resolver->connection();
|
||||||
|
@ -41,7 +41,6 @@ class ContainerStub
|
|||||||
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
||||||
|
|
||||||
$resolver = new ConnectionResolver($container);
|
$resolver = new ConnectionResolver($container);
|
||||||
$container->shouldReceive('get')->with(ConnectionResolver::class)->andReturn($resolver);
|
|
||||||
$container->shouldReceive('get')->with(ConnectionResolverInterface::class)->andReturn($resolver);
|
$container->shouldReceive('get')->with(ConnectionResolverInterface::class)->andReturn($resolver);
|
||||||
|
|
||||||
$config = new Config([
|
$config = new Config([
|
||||||
@ -105,7 +104,7 @@ class ContainerStub
|
|||||||
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
||||||
|
|
||||||
$resolver = new ConnectionResolver($container);
|
$resolver = new ConnectionResolver($container);
|
||||||
$container->shouldReceive('get')->with(ConnectionResolver::class)->andReturn($resolver);
|
$container->shouldReceive('get')->with(ConnectionResolverInterface::class)->andReturn($resolver);
|
||||||
|
|
||||||
$config = new Config([
|
$config = new Config([
|
||||||
'databases' => [
|
'databases' => [
|
||||||
|
@ -15,6 +15,7 @@ namespace HyperfTest\ModelCache\Stub;
|
|||||||
use Hyperf\Config\Config;
|
use Hyperf\Config\Config;
|
||||||
use Hyperf\Contract\ConfigInterface;
|
use Hyperf\Contract\ConfigInterface;
|
||||||
use Hyperf\Contract\StdoutLoggerInterface;
|
use Hyperf\Contract\StdoutLoggerInterface;
|
||||||
|
use Hyperf\Database\ConnectionResolverInterface;
|
||||||
use Hyperf\Database\Connectors\ConnectionFactory;
|
use Hyperf\Database\Connectors\ConnectionFactory;
|
||||||
use Hyperf\Database\Connectors\MySqlConnector;
|
use Hyperf\Database\Connectors\MySqlConnector;
|
||||||
use Hyperf\DbConnection\ConnectionResolver;
|
use Hyperf\DbConnection\ConnectionResolver;
|
||||||
@ -47,7 +48,7 @@ class ContainerStub
|
|||||||
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
$container->shouldReceive('get')->with(PoolFactory::class)->andReturn($factory);
|
||||||
|
|
||||||
$resolver = new ConnectionResolver($container);
|
$resolver = new ConnectionResolver($container);
|
||||||
$container->shouldReceive('get')->with(ConnectionResolver::class)->andReturn($resolver);
|
$container->shouldReceive('get')->with(ConnectionResolverInterface::class)->andReturn($resolver);
|
||||||
|
|
||||||
$config = new Config([
|
$config = new Config([
|
||||||
StdoutLoggerInterface::class => [
|
StdoutLoggerInterface::class => [
|
||||||
|
@ -19,7 +19,6 @@ use Hyperf\Database\Connectors\ConnectionFactory;
|
|||||||
use Hyperf\Database\Connectors\MySqlConnector;
|
use Hyperf\Database\Connectors\MySqlConnector;
|
||||||
use Hyperf\Database\Model\Register;
|
use Hyperf\Database\Model\Register;
|
||||||
use Hyperf\Database\Schema\Builder;
|
use Hyperf\Database\Schema\Builder;
|
||||||
use Hyperf\DbConnection\ConnectionResolver as DBConnectionResolver;
|
|
||||||
use Hyperf\DbConnection\Model\Model;
|
use Hyperf\DbConnection\Model\Model;
|
||||||
use Hyperf\Server\Entry\EventDispatcher;
|
use Hyperf\Server\Entry\EventDispatcher;
|
||||||
use Hyperf\Translation\ArrayLoader;
|
use Hyperf\Translation\ArrayLoader;
|
||||||
@ -60,7 +59,7 @@ class ValidationExistsRuleTest extends TestCase
|
|||||||
];
|
];
|
||||||
$connection = $connector->make($dbConfig);
|
$connection = $connector->make($dbConfig);
|
||||||
$resolver = new ConnectionResolver(['default' => $connection]);
|
$resolver = new ConnectionResolver(['default' => $connection]);
|
||||||
$container->shouldReceive('get')->with(DBConnectionResolver::class)->andReturn($resolver);
|
$container->shouldReceive('get')->with(ConnectionResolverInterface::class)->andReturn($resolver);
|
||||||
ApplicationContext::setContainer($container);
|
ApplicationContext::setContainer($container);
|
||||||
Register::setConnectionResolver($resolver);
|
Register::setConnectionResolver($resolver);
|
||||||
$container->shouldReceive('get')->with(EventDispatcherInterface::class)->andReturn(new EventDispatcher());
|
$container->shouldReceive('get')->with(EventDispatcherInterface::class)->andReturn(new EventDispatcher());
|
||||||
|
Loading…
Reference in New Issue
Block a user