DbalFunctionalTestCase.php 774B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Doctrine\Tests;
  3. class DbalFunctionalTestCase extends DbalTestCase
  4. {
  5. /* Shared connection when a TestCase is run alone (outside of it's functional suite) */
  6. private static $_sharedConn;
  7. /**
  8. * @var Doctrine\DBAL\Connection
  9. */
  10. protected $_conn;
  11. protected function resetSharedConn()
  12. {
  13. $this->sharedFixture['conn'] = null;
  14. self::$_sharedConn = null;
  15. }
  16. protected function setUp()
  17. {
  18. if (isset($this->sharedFixture['conn'])) {
  19. $this->_conn = $this->sharedFixture['conn'];
  20. } else {
  21. if ( ! isset(self::$_sharedConn)) {
  22. self::$_sharedConn = TestUtil::getConnection();
  23. }
  24. $this->_conn = self::$_sharedConn;
  25. }
  26. }
  27. }