TestCase.php 461 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Alcaeus\MongoDbAdapter\Tests;
  3. use MongoDB\Client;
  4. abstract class TestCase extends \PHPUnit_Framework_TestCase
  5. {
  6. protected function tearDown()
  7. {
  8. $this->getCheckDatabase()->drop();
  9. }
  10. /**
  11. * @return \MongoDB\Database
  12. */
  13. protected function getCheckDatabase()
  14. {
  15. $client = new Client('mongodb://localhost', ['connect' => true]);
  16. return $client->selectDatabase('mongo-php-adapter');
  17. }
  18. }