mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #16558: Added cloning yii\data\ActiveDataProvider::query
property when ActiveDataProvider object is cloned
This commit is contained in:

committed by
Alexander Makarov

parent
0ddc3bf58c
commit
e53fc0ded1
34
tests/framework/data/ActiveDataProviderCloningTest.php
Normal file
34
tests/framework/data/ActiveDataProviderCloningTest.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace yiiunit\framework\data;
|
||||
|
||||
use yii\data\ActiveDataProvider;
|
||||
use yii\db\Query;
|
||||
use yiiunit\TestCase;
|
||||
|
||||
class ActiveDataProviderCloningTest extends TestCase
|
||||
{
|
||||
|
||||
// Tests :
|
||||
|
||||
public function testClone()
|
||||
{
|
||||
$queryFirst = new Query();
|
||||
|
||||
$dataProviderFirst = new ActiveDataProvider([
|
||||
'query' => $queryFirst
|
||||
]);
|
||||
|
||||
$dataProviderSecond = clone $dataProviderFirst;
|
||||
|
||||
$querySecond = $dataProviderSecond->query;
|
||||
|
||||
$this->assertNotSame($querySecond, $queryFirst);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user