0

Has anyone got this working?

I know the docs say that ms sql support is not tested, so I wonder if anyone had it working?

I have enabled the Db module in acceptance.suite.yml

And my credentials in codeception.yml look like this:

modules:
config:
    Db:
        dsn: 'mssql:host=******.db.8876686.hostedresource.com;dbname=*******'
        user: '*******'
        password: '******'
        dump: app/tests/_data/dump.sql

In my cest file, I have the following function:

    public function testUserDb(WebGuy $I)
{
    $I->seeInDatabase('Users',['Email' => 'someguy@email.com']);
}

But I get the following error when running:

  [Codeception\Exception\Module]
    (Exception in Db) could not find driver while creating PDO connection

So I'm guessing ms sql doesn't work..

It looks like I'm not going to have any joy - anyone know if Behat has ms sql / sql server support?

Thanks

Jon.

HowApped
  • 1,001
  • 3
  • 12
  • 22

1 Answers1

1

Behat itself doesn't have anything to do with databases. If you need connecting to one from a Behat context file, you just use whatever is used in your application.

I've successfully used Doctrine with Behat for example, also with mssql.

For mssql integration you will need the doctrine-pdo-dblib package.

Jakub Zalas
  • 35,761
  • 9
  • 93
  • 125
  • Thanks, For what it's worth. I've gone with Behat for the acceptance testing choosing to execute a stored procedure to reset the DB and perform integration tests in isolation. – HowApped Sep 09 '13 at 15:14