Updated PHPUnit to 9.0

parent 59dffec1
This diff is collapsed.
...@@ -104,7 +104,7 @@ class OCI8StatementTest extends DbalTestCase ...@@ -104,7 +104,7 @@ class OCI8StatementTest extends DbalTestCase
public function testConvertNonTerminatedLiteral(string $sql, string $message) : void public function testConvertNonTerminatedLiteral(string $sql, string $message) : void
{ {
$this->expectException(OCI8Exception::class); $this->expectException(OCI8Exception::class);
$this->expectExceptionMessageRegExp($message); $this->expectExceptionMessageMatches($message);
OCI8Statement::convertPositionalToNamedPlaceholders($sql); OCI8Statement::convertPositionalToNamedPlaceholders($sql);
} }
......
...@@ -6,7 +6,6 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2; ...@@ -6,7 +6,6 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PHPUnit\Framework\Error\Notice;
use function extension_loaded; use function extension_loaded;
class DB2StatementTest extends DbalFunctionalTestCase class DB2StatementTest extends DbalFunctionalTestCase
...@@ -33,7 +32,7 @@ class DB2StatementTest extends DbalFunctionalTestCase ...@@ -33,7 +32,7 @@ class DB2StatementTest extends DbalFunctionalTestCase
// unwrap the statement to prevent the wrapper from handling the PHPUnit-originated exception // unwrap the statement to prevent the wrapper from handling the PHPUnit-originated exception
$wrappedStmt = $stmt->getWrappedStatement(); $wrappedStmt = $stmt->getWrappedStatement();
$this->expectException(Notice::class); $this->expectNotice();
$wrappedStmt->execute([[]]); $wrappedStmt->execute([[]]);
} }
} }
...@@ -128,7 +128,11 @@ class PortabilityTest extends DbalFunctionalTestCase ...@@ -128,7 +128,11 @@ class PortabilityTest extends DbalFunctionalTestCase
*/ */
public function assertFetchResultRow(array $row) : void public function assertFetchResultRow(array $row) : void
{ {
self::assertContains($row['test_int'], [1, 2], 'Primary key test_int should either be 1 or 2.'); self::assertThat($row['test_int'], self::logicalOr(
self::equalTo(1),
self::equalTo(2)
));
self::assertArrayHasKey('test_string', $row, 'Case should be lowered.'); self::assertArrayHasKey('test_string', $row, 'Case should be lowered.');
self::assertEquals(3, strlen($row['test_string']), 'test_string should be rtrimed to length of three for CHAR(32) column.'); self::assertEquals(3, strlen($row['test_string']), 'test_string should be rtrimed to length of three for CHAR(32) column.');
self::assertNull($row['test_null']); self::assertNull($row['test_null']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment