<commit_before><?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\data\ar\ActiveRecord;
use yiiunit\data\ar\Customer;
use yiiunit\data\ar\Item;
use yiiunit\framework\db\DatabaseTestCase;
use yiiunit\data\ar\Order;

/**
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 *
 * @group data
 * @group db
 */
class ActiveDataProviderTest extends DatabaseTestCase
{
	protected function setUp()
	{
		parent::setUp();
		ActiveRecord::$db = $this->getConnection();
	}

	public function testActiveQuery()
	{
		$provider = new ActiveDataProvider([
			'query' => Order::find()->orderBy('id'),
		]);
		$orders = $provider->getModels();
		$this->assertEquals(3, count($orders));
		$this->assertTrue($orders[0] instanceof Order);
		$this->assertTrue($orders[1] instanceof Order);
		$this->assertTrue($orders[2] instanceof Order);<commit_msg>fixed test break after #1207<commit_after><?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\data\ar\ActiveRecord;
use yiiunit\data\ar\Customer;
use yiiunit\data\ar\Item;
use yiiunit\framework\db\DatabaseTestCase;
use yiiunit\data\ar\Order;

/**
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 *
 * @group data
 * @group db
 */
class ActiveDataProviderTest extends DatabaseTestCase
{
	protected function setUp()
	{
		parent::setUp();
		ActiveRecord::$db = $this->getConnection();
		$this->mockApplication([
			'request' => 'yii\\web\\Request',
		]);
	}

	public function testActiveQuery()
	{
		$provider = new ActiveDataProvider([
			'query' => Order::find()->orderBy('id'),
		]);
		$orders = $provider->getModels();
		$this->assertEquals(3, count($orders));
		$this->assertTrue($orders[0] instanceof Order);
		$this->assertTrue($orders[1] instanceof Order);
		$this->assertTrue($orders[2] instanceof Order);
{'fraction_non_alphanumeric': 0.1708352996696555, 'fraction_numerical': 0.011326097215667769, 'mean_word_length': 4.7923497267759565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6434932', 'n_tokens_mistral': 748, 'n_tokens_neox': 709, 'n_words': 142}