Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Feb 20, 2018
1 parent 46eff83 commit 21dd7b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/TestCase/Database/Driver/MysqlTest.php
Expand Up @@ -44,7 +44,7 @@ public function setup()
public function testConnectionConfigDefault()
{
$driver = $this->getMockBuilder('Cake\Database\Driver\Mysql')
->setMethods(['_connect', 'connection'])
->setMethods(['_connect', 'getConnection'])
->getMock();
$dsn = 'mysql:host=localhost;port=3306;dbname=cake;charset=utf8mb4';
$expected = [
Expand Down Expand Up @@ -73,7 +73,7 @@ public function testConnectionConfigDefault()
->with($dsn, $expected);

$driver->expects($this->any())
->method('connection')
->method('getConnection')
->will($this->returnValue($connection));
$driver->connect([]);
}
Expand Down Expand Up @@ -101,7 +101,7 @@ public function testConnectionConfigCustom()
]
];
$driver = $this->getMockBuilder('Cake\Database\Driver\Mysql')
->setMethods(['_connect', 'connection'])
->setMethods(['_connect', 'getConnection'])
->setConstructorArgs([$config])
->getMock();
$dsn = 'mysql:host=foo;port=3440;dbname=bar;charset=some-encoding';
Expand All @@ -125,7 +125,7 @@ public function testConnectionConfigCustom()

$driver->expects($this->once())->method('_connect')
->with($dsn, $expected);
$driver->expects($this->any())->method('connection')
$driver->expects($this->any())->method('getConnection')
->will($this->returnValue($connection));
$driver->connect($config);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/Driver/PostgresTest.php
Expand Up @@ -147,7 +147,7 @@ public function testConnectionConfigCustom()
public function testInsertReturning()
{
$driver = $this->getMockBuilder('Cake\Database\Driver\Postgres')
->setMethods(['_connect', 'connection'])
->setMethods(['_connect', 'getConnection'])
->setConstructorArgs([[]])
->getMock();
$connection = $this
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Database/Driver/SqliteTest.php
Expand Up @@ -73,7 +73,7 @@ public function testConnectionConfigCustom()
'mask' => 0666
];
$driver = $this->getMockBuilder('Cake\Database\driver\Sqlite')
->setMethods(['_connect', 'connection'])
->setMethods(['_connect', 'getConnection'])
->setConstructorArgs([$config])
->getMock();
$dsn = 'sqlite:bar.db';
Expand All @@ -95,7 +95,7 @@ public function testConnectionConfigCustom()

$driver->expects($this->once())->method('_connect')
->with($dsn, $expected);
$driver->expects($this->any())->method('connection')
$driver->expects($this->any())->method('getConnection')
->will($this->returnValue($connection));
$driver->connect($config);
}
Expand Down

0 comments on commit 21dd7b0

Please sign in to comment.