diff --git a/tests/framework/db/ConnectionTest.php b/tests/framework/db/ConnectionTest.php index ed38ed785bb..848ec9ddad1 100644 --- a/tests/framework/db/ConnectionTest.php +++ b/tests/framework/db/ConnectionTest.php @@ -219,9 +219,10 @@ public function testTransactionIsolation() $transaction->commit(); $transaction = $connection->beginTransaction(Transaction::SERIALIZABLE); - $transaction->commit(); - $this->assertTrue(true); // should not be any exception so far + $this->expectNotToPerformAssertions(); + + $transaction->commit(); } public function testTransactionShortcutException() diff --git a/tests/framework/db/oci/ActiveRecordTest.php b/tests/framework/db/oci/ActiveRecordTest.php index 6be10ccc352..b73224ee6de 100644 --- a/tests/framework/db/oci/ActiveRecordTest.php +++ b/tests/framework/db/oci/ActiveRecordTest.php @@ -25,9 +25,8 @@ class ActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest public function testCastValues() { - // pass, because boolean casting is not available - return; $model = new Type(); + $model->int_col = 123; $model->int_col2 = 456; $model->smallint_col = 42; @@ -42,13 +41,14 @@ public function testCastValues() /* @var $model Type */ $model = Type::find()->one(); + $this->assertSame(123, $model->int_col); $this->assertSame(456, $model->int_col2); $this->assertSame(42, $model->smallint_col); $this->assertSame('1337', trim($model->char_col)); $this->assertSame('test', $model->char_col2); $this->assertSame('test123', $model->char_col3); - $this->assertSame(1337.42, $model->float_col); + $this->assertSame(3.742, $model->float_col); $this->assertSame(42.1337, $model->float_col2); $this->assertEquals('1', $model->bool_col); $this->assertEquals('0', $model->bool_col2); diff --git a/tests/framework/db/oci/ConnectionTest.php b/tests/framework/db/oci/ConnectionTest.php index 0d0bf842ef6..6a6aaba991e 100644 --- a/tests/framework/db/oci/ConnectionTest.php +++ b/tests/framework/db/oci/ConnectionTest.php @@ -84,6 +84,9 @@ public function testTransactionIsolation() $transaction->commit(); $transaction = $connection->beginTransaction(Transaction::SERIALIZABLE); + + $this->expectNotToPerformAssertions(); + $transaction->commit(); } diff --git a/tests/framework/db/pgsql/ConnectionTest.php b/tests/framework/db/pgsql/ConnectionTest.php index c3a6d0c68eb..16defb7e8e3 100644 --- a/tests/framework/db/pgsql/ConnectionTest.php +++ b/tests/framework/db/pgsql/ConnectionTest.php @@ -99,8 +99,9 @@ public function testTransactionIsolation() $transaction = $connection->beginTransaction(); $transaction->setIsolationLevel(Transaction::SERIALIZABLE . ' READ ONLY DEFERRABLE'); - $transaction->commit(); - $this->assertTrue(true); // No error occurred – assert passed. + $this->expectNotToPerformAssertions(); + + $transaction->commit(); } } diff --git a/tests/framework/db/sqlite/ConnectionTest.php b/tests/framework/db/sqlite/ConnectionTest.php index 5ff572313f6..7b41cd5b44d 100644 --- a/tests/framework/db/sqlite/ConnectionTest.php +++ b/tests/framework/db/sqlite/ConnectionTest.php @@ -44,9 +44,10 @@ public function testTransactionIsolation() $transaction->rollBack(); $transaction = $connection->beginTransaction(Transaction::SERIALIZABLE); - $transaction->rollBack(); - $this->assertTrue(true); // No exceptions means test is passed. + $this->expectNotToPerformAssertions(); + + $transaction->rollBack(); } public function testMasterSlave()