diff options
Diffstat (limited to 'tests/lib/DB/ConnectionTest.php')
-rw-r--r-- | tests/lib/DB/ConnectionTest.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/DB/ConnectionTest.php b/tests/lib/DB/ConnectionTest.php index 02dd6a1495c..607674d7a38 100644 --- a/tests/lib/DB/ConnectionTest.php +++ b/tests/lib/DB/ConnectionTest.php @@ -26,12 +26,12 @@ class ConnectionTest extends \Test\TestCase { */ private $connection; - public static function setUpBeforeClass() { + public static function setUpBeforeClass(): void { self::dropTestTable(); parent::setUpBeforeClass(); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { self::dropTestTable(); parent::tearDownAfterClass(); } @@ -42,12 +42,12 @@ class ConnectionTest extends \Test\TestCase { } } - public function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); } - public function tearDown() { + protected function tearDown(): void { parent::tearDown(); $this->connection->dropTable('table'); } @@ -157,10 +157,10 @@ class ConnectionTest extends \Test\TestCase { $this->assertEquals('bar', $this->getTextValueByIntergerField(1)); } - /** - * @expectedException \OCP\PreConditionNotMetException - */ + public function testSetValuesOverWritePreconditionFailed() { + $this->expectException(\OCP\PreConditionNotMetException::class); + $this->makeTestTable(); $this->connection->setValues('table', [ 'integerfield' => 1 @@ -335,10 +335,10 @@ class ConnectionTest extends \Test\TestCase { $this->assertEquals(0, $result); } - /** - * @expectedException \Doctrine\DBAL\Exception\UniqueConstraintViolationException - */ + public function testUniqueConstraintViolating() { + $this->expectException(\Doctrine\DBAL\Exception\UniqueConstraintViolationException::class); + $this->makeTestTable(); $testQuery = 'INSERT INTO `*PREFIX*table` (`integerfield`, `textfield`) VALUES(?, ?)'; |