Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f6cb910

Browse files
committed
Update tests and PHPUnit constraints
1 parent a4bf66a commit f6cb910

File tree

12 files changed

+175
-120
lines changed

12 files changed

+175
-120
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"zendframework/zend-stdlib": "^2.7 || ^3.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^5.7.25 || ^6.4.4",
23+
"phpunit/phpunit": "^5.7.27 || ^6.5.14",
2424
"zendframework/zend-coding-standard": "~1.0.0",
2525
"zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
2626
"zendframework/zend-hydrator": "^1.1 || ^2.1 || ^3.0",
@@ -67,7 +67,7 @@
6767
"cs-fix": "phpcbf",
6868
"test": "phpunit --colors=always --testsuite \"unit test\"",
6969
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
70-
"test-integration" : "phpunit --colors=always --testsuite \"integration test\"",
70+
"test-integration": "phpunit --colors=always --testsuite \"integration test\"",
7171
"upload-coverage": "coveralls -v"
7272
}
7373
}

composer.lock

Lines changed: 151 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/integration/Adapter/Driver/Pdo/Mysql/AdapterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
trait AdapterTrait
88
{
9-
public function setUp()
9+
protected function setUp()
1010
{
1111
if (! getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_MYSQL')) {
1212
$this->markTestSkipped('pdo_mysql integration tests are not enabled!');

test/integration/Adapter/Platform/MysqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MysqlTest extends TestCase
2222
{
2323
public $adapters = [];
2424

25-
public function setUp()
25+
protected function setUp()
2626
{
2727
if (! getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_MYSQL')) {
2828
$this->markTestSkipped(__CLASS__ . ' integration tests are not enabled!');

test/integration/Adapter/Platform/PostgresqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class PostgresqlTest extends TestCase
2222
{
2323
public $adapters = [];
2424

25-
public function setUp()
25+
protected function setUp()
2626
{
2727
if (! getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_PGSQL')) {
2828
$this->markTestSkipped(__CLASS__ . ' integration tests are not enabled!');

test/integration/Adapter/Platform/SqlServerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SqlServerTest extends TestCase
2020
{
2121
public $adapters = [];
2222

23-
public function setUp()
23+
protected function setUp()
2424
{
2525
if (! getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_SQLSRV')) {
2626
$this->markTestSkipped(__CLASS__ . ' integration tests are not enabled!');

test/integration/Adapter/Platform/SqliteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SqliteTest extends TestCase
2121
{
2222
public $adapters = [];
2323

24-
public function setUp()
24+
protected function setUp()
2525
{
2626
if (! getenv('TESTS_ZEND_DB_ADAPTER_DRIVER_SQLITE_MEMORY')) {
2727
$this->markTestSkipped(__CLASS__ . ' integration tests are not enabled!');

test/unit/Adapter/Driver/IbmDb2/StatementIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function testPrepare()
102102
}
103103

104104
/**
105-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
105+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
106106
*/
107107
public function testPrepareThrowsAnExceptionOnFailure()
108108
{
@@ -113,12 +113,12 @@ public function testPrepareThrowsAnExceptionOnFailure()
113113
);
114114
$statement = new Statement;
115115
$statement->initialize($db2Resource);
116-
$this->setExpectedException(RuntimeException::class);
116+
$this->expectException(RuntimeException::class);
117117
$statement->prepare("SELECT");
118118
}
119119

120120
/**
121-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::execute
121+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::execute
122122
*/
123123
public function testExecute()
124124
{

test/unit/Adapter/Driver/IbmDb2/StatementTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function testGetSql()
110110
}
111111

112112
/**
113-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
114-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::isPrepared
113+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
114+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::isPrepared
115115
*/
116116
public function testPrepare()
117117
{
@@ -121,8 +121,8 @@ public function testPrepare()
121121
}
122122

123123
/**
124-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
125-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::isPrepared
124+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
125+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::isPrepared
126126
*/
127127
public function testPreparingTwiceErrors()
128128
{
@@ -138,8 +138,8 @@ public function testPreparingTwiceErrors()
138138
}
139139

140140
/**
141-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
142-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::setSql
141+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
142+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::setSql
143143
*/
144144
public function testPrepareThrowsRuntimeExceptionOnInvalidSql()
145145
{
@@ -158,8 +158,8 @@ public function testPrepareThrowsRuntimeExceptionOnInvalidSql()
158158
* be called, but a RuntimeException will still be generated as the
159159
* resource is false
160160
*
161-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
162-
* @covers Zend\Db\Adapter\Driver\IbmDb2\Statement::setSql
161+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::prepare
162+
* @covers \Zend\Db\Adapter\Driver\IbmDb2\Statement::setSql
163163
*/
164164
public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingDisabled()
165165
{

test/unit/Adapter/Driver/Sqlsrv/SqlSrvIntegrationTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SqlSrvIntegrationTest extends AbstractIntegrationTest
2727
*/
2828
private $resource;
2929

30-
public function setUp()
30+
protected function setUp()
3131
{
3232
parent::setUp();
3333
$this->resource = $this->adapters['sqlsrv'];
@@ -53,10 +53,8 @@ public function testCreateStatement()
5353
$stmt = $this->driver->createStatement();
5454
$this->assertInstanceOf('Zend\Db\Adapter\Driver\Sqlsrv\Statement', $stmt);
5555

56-
$this->setExpectedException(
57-
'Zend\Db\Adapter\Exception\InvalidArgumentException',
58-
'only accepts an SQL string or a Sqlsrv resource'
59-
);
56+
$this->expectException('Zend\Db\Adapter\Exception\InvalidArgumentException');
57+
$this->expectExceptionMessage('only accepts an SQL string or a Sqlsrv resource');
6058
$this->driver->createStatement(new \stdClass);
6159
}
6260

0 commit comments

Comments
 (0)