Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

odbc / freetds / sqlsrv #170

Closed
rbredlau opened this issue Aug 13, 2015 · 2 comments
Closed

odbc / freetds / sqlsrv #170

rbredlau opened this issue Aug 13, 2015 · 2 comments
Labels

Comments

@rbredlau
Copy link

When using odbc and freetds to access MS SQL Server from a Linux environment, dbunit fails with an error about a missing metadata driver (no meta data driver for odbc).

A simple work around is to create a subclass of the PDO class you want to test:

/**
* In my application...
*/
class PDO_MsSql extends PDO {
    ...
}

/**
* In my test code...
*/
class Testing_PDO_MsSqlTest extends PDO_MsSql {
    ...

    public function getAttribute( $attribute ) {
        if( $attribute === PDO::ATTR_DRIVER_NAME && PHP_OS === 'Linux' ) {
            return 'sqlsrv';
        } else {
            return parent::getAttribute( $attribute );
        }
   }
}
@stale
Copy link

stale bot commented Apr 18, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2018
@stale
Copy link

stale bot commented Apr 25, 2018

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.

@stale stale bot closed this as completed Apr 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant