remove expectedException from annotation

This commit is contained in:
Anton Grebnev
2011-12-06 16:22:04 +04:00
parent a942745039
commit 650f311b2b
3 changed files with 15 additions and 37 deletions

View File

@ -72,25 +72,18 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
}
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage Configuration must have a "hostname".
*/
public function testGetConnectionNoHostname()
{
unset($this->conf['hostname']);
$this->setExpectedException('GeneralException', 'Configuration must have a "hostname"');
$mongo = new MongoDriver($this->conf);
$mongo->getConnection();
}
/**
* @expectedException MongoConnectionException
* @expectedExceptionMessage Couldn't authenticate with database
*/
public function testGetConnectionWrongPassword()
{
$this->conf['password'] = 'nopass';
$mongo = new MongoDriver($this->conf);
$this->setExpectedException('MongoConnectionException', 'Couldn\'t authenticate with database');
$this->assertInstanceOf('MongoDB', $mongo->getConnection());
}
@ -323,8 +316,5 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
$mongo = new MongoDriver($this->conf);
$result = $mongo->command('items', array('distinct' =>'items', 'key' => 'name'));
$this->assertEquals(4, count($result->fetch(DB::FETCH_ASSOC)));
}
}