Skip to content

Commit 1cb19d1

Browse files
committed
test find on empty DB
1 parent ea17a88 commit 1cb19d1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/ActiveRecordTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,15 @@ public function testEscapeData()
417417
$c = Customer::findOne(['email' => "the People's Republic of China"]);
418418
$this->assertSame("the People's Republic of China", $c->email);
419419
}
420+
421+
public function testFindEmptyWith()
422+
{
423+
Order::getDb()->flushdb();
424+
$orders = Order::find()
425+
->where(['total' => 100000])
426+
->orWhere(['total' => 1])
427+
->with('customer')
428+
->all();
429+
$this->assertEquals([], $orders);
430+
}
420431
}

tests/RedisCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RedisCacheTest extends CacheTestCase
2020
*/
2121
protected function getCacheInstance()
2222
{
23-
$databases = self::getParam('databases');
23+
$databases = TestCase::getParam('databases');
2424
$params = isset($databases['redis']) ? $databases['redis'] : null;
2525
if ($params === null) {
2626
$this->markTestSkipped('No redis server connection configured.');

0 commit comments

Comments
 (0)