mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 14:28:27 +08:00
31 lines
674 B
PHP
31 lines
674 B
PHP
<?php
|
|
/**
|
|
* @link https://www.yiiframework.com/
|
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
|
* @license https://www.yiiframework.com/license/
|
|
*/
|
|
|
|
namespace yiiunit\framework\data;
|
|
|
|
use yii\data\ActiveDataProvider;
|
|
use yii\db\Query;
|
|
use yiiunit\TestCase;
|
|
|
|
class ActiveDataProviderCloningTest extends TestCase
|
|
{
|
|
public function testClone(): void
|
|
{
|
|
$queryFirst = new Query();
|
|
|
|
$dataProviderFirst = new ActiveDataProvider([
|
|
'query' => $queryFirst
|
|
]);
|
|
|
|
$dataProviderSecond = clone $dataProviderFirst;
|
|
|
|
$querySecond = $dataProviderSecond->query;
|
|
|
|
$this->assertNotSame($querySecond, $queryFirst);
|
|
}
|
|
}
|