2 namespace Doctrine\Tests\DBAL\Sharding\SQLAzure;
4 use Doctrine\DBAL\Sharding\SQLAzure\SQLAzureSchemaSynchronizer;
6 class FunctionalTest extends AbstractTestCase
8 public function testSharding()
10 $schema = $this->createShopSchema();
12 $synchronizer = new SQLAzureSchemaSynchronizer($this->conn, $this->sm);
13 $synchronizer->dropAllSchema();
14 $synchronizer->createSchema($schema);
16 $this->sm->selectShard(0);
18 $this->conn->insert("Products", array(
21 "ProductName" => "Test",
25 $this->conn->insert("Customers", array(
27 "CompanyName" => "Foo",
28 "FirstName" => "Benjamin",
32 $query = "SELECT * FROM Products";
33 $data = $this->conn->fetchAll($query);
34 $this->assertTrue(count($data) > 0);
36 $query = "SELECT * FROM Customers";
37 $data = $this->conn->fetchAll($query);
38 $this->assertTrue(count($data) > 0);
40 $data = $this->sm->queryAll("SELECT * FROM Customers");
41 $this->assertTrue(count($data) > 0);