Repo2\QueryReactor\Tests\Sharding\ShardingControllerTest::testQueryToSingleShard PHP Method

testQueryToSingleShard() public method

    public function testQueryToSingleShard()
    {
        $shardParams = TestUtil::getControllerParams() + ['id' => 1];
        $sharding = $this->getShardingMock();
        $sharding->expects($this->never())->method('selectGlobal');
        $sharding->expects($this->once())->method('selectShard')->will($this->returnValue($shardParams));
        $query = $this->getShardedQueryMock(Fixtures::getSelect());
        $query->expects($this->once())->method('getDistributionName');
        $query->expects($this->once())->method('getDistributionValue');
        $query->expects($this->once())->method('resolve');
        $query->expects($this->never())->method('reject');
        $reactor = $this->createReactor($this->createShardingController($sharding));
        $reactor->execQuery($query)->await();
    }