public function testSelectShard() { $conn = $this->createConnection(array('sharding' => array('federationName' => 'abc', 'distributionKey' => 'foo', 'distributionType' => 'integer'))); $conn->expects($this->at(1))->method('isTransactionActive')->will($this->returnValue(true)); $this->setExpectedException('Doctrine\\Shards\\DBAL\\ShardingException', 'Cannot switch shard during an active transaction.'); $sm = new SQLAzureShardManager($conn); $sm->selectShard(1234); $this->assertEquals(1234, $sm->getCurrentDistributionValue()); }