hasConnectionGroup() public static method

Determine if a connection group exists
public static hasConnectionGroup ( string $name )
$name string The name of the connection group
Beispiel #1
0
 public function testConnectionGroups()
 {
     $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, Shanty_Mongo::getConnectionGroups());
     $this->assertEquals(0, count(Shanty_Mongo::getConnectionGroups()));
     $connectionGroup = new Shanty_Mongo_Connection_Group();
     Shanty_Mongo::setConnectionGroup('users', $connectionGroup);
     $this->assertEquals(1, count(Shanty_Mongo::getConnectionGroups()));
     $this->assertEquals(Shanty_Mongo::getConnectionGroup('users'), $connectionGroup);
     $this->assertFalse(Shanty_Mongo::hasConnectionGroup('accounts'));
     $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, Shanty_Mongo::getConnectionGroup('accounts'));
     $this->assertEquals(2, count(Shanty_Mongo::getConnectionGroups()));
     $this->assertTrue(Shanty_Mongo::hasConnectionGroup('accounts'));
 }