Example #1
0
 /**
  * @covers Paradox\Client::createDatabase
  * @covers Paradox\Client::deleteDatabase
  */
 public function testCreateAndDeleteDatabase()
 {
     $this->client->createDatabase('mynewtestdatabase');
     //Check that the database exists
     $databaseInfo = $this->client->getDatabaseInfo('mynewtestdatabase');
     $this->assertInternalType('array', $databaseInfo, 'The database info should be an array');
     $this->assertNotEmpty($databaseInfo, 'The database info should not be empty');
     //Delete the database
     $this->client->deleteDatabase('mynewtestdatabase');
     try {
         $databaseInfo = $this->client->getDatabaseInfo('mynewtestdatabase');
     } catch (\Exception $e) {
         $this->assertInstanceOf('Paradox\\exceptions\\DatabaseManagerException', $e, 'Exception thrown was not a Paradox\\exceptions\\DatabaseManagerException');
         return;
     }
     $this->fail("Tried to get info on a database that does not exist, but no exception was thrown");
 }