Skip to content

Commit

Permalink
Fix connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
nohponex committed Nov 27, 2015
1 parent e3a2434 commit c0107e0
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "phramework/phramework",
"description": "PHP framework for RESTful services",
"license": "Apache-2.0",
"homepage": "https://github.com/phramework",
"type": "library",
"keywords": [
"RESTful"
],
"homepage": "https://github.com/phramework/phramework",
"authors": [{
"name": "Spafaridis Xenofon",
"email": "nohponex@gmail.com",
Expand Down
2 changes: 1 addition & 1 deletion src/Database/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public function __construct($settingsDb)
if (!($this->link = new PDO(sprintf(
"pgsql:dbname=%shost=%s;user=%s;password=%s;port=%s",
$settingsDb['name'],
$settingsDb['host'],
$settingsDb['username'],
$settingsDb['password'],
$settingsDb['host'],
$settingsDb['port']
)))) {
throw new DatabaseException('Cannot connect to database');
Expand Down
20 changes: 20 additions & 0 deletions tests/src/Database/DatabaseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Phramework\Database;

class DatabaseTest extends \PHPUnit_Framework_TestCase
{

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
//$settingsDb = \Phramework\Phramework::getSettings('db');

/*Database::setAdapter(
new MySQL($settings);
);*/
}
}
15 changes: 15 additions & 0 deletions tests/src/Database/MySQLTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Phramework\Database;

class MySQLTest extends \PHPUnit_Framework_TestCase
{

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
}
}
15 changes: 15 additions & 0 deletions tests/src/Database/PostgreSQLTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Phramework\Database;

class PostgreSQLTest extends \PHPUnit_Framework_TestCase
{

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
}
}

0 comments on commit c0107e0

Please sign in to comment.