Codeception in mamp/bitnami stack

Hi, I’m really struggling to get codeception up and running in advanced template. I running yii in a mamp stack and the site runs fine. If I try and run codeception i get this db error

missing "=" after "localhost" in connection info string

I am trying to run it using

/Applications/mappstack-5.4.28-0/php/bin/php /Applications/mappstack-5.4.28-0/apache2/htdocs/sitename/vendor/bin/codecept run

I have made sure I know which db string is being used by having just one in common main-local. if I remove that I get a db missing error so it’s definitely using that connection string. I am using postgres. I have tried using 127.0.0.1 instead but it makes no difference. The site itself runs fine with no connection issue. Is it to do with php version? How can I tell.

‘db’ => [

        'class' => 'yii\db\Connection',


        'dsn' => 'pgsql:host=localhost;port=5432;dbname=mydbname',


        'username' => 'siteadmin',


        'password' => 'murray12',


        'charset' => 'utf8',


        


    ],