<commit_before><?php
use Resto\Common\Resource;

class ModelTest extends PHPUnit_Framework_TestCase
{
	public function testSetAttributeWithoutMutator()
	{
		$model = new SampleModel;

		$model->id         = 2;
		$model->first_name = 'Sahan';
		$model->last_name  = 'H';

		$this->assertAttributeEquals(array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H'), 'attributes', $model);
	}

	public function testFillRaw()
	{
		$data  = array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H');
		$model = new SampleModel;
		$model->fillRaw($data);

		$this->assertAttributeEquals($data, 'attributes', $model);
	}

	public function testFill()
	{
		$data  = array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H');
		$model = new SampleModel;
		$model->fillRaw($data);

		$this->assertAttributeEquals($data, 'attributes', $model);
	}

	public function testGetSetAttributeWithMutator()
	{
		$model = new Foo\SampleModelConfigured;
		$model->first_name = 'SAHAN';

		$this->assertAttributeEquals(array('first_name' => 'sahan'), 'attributes', $model);
		$this->assertEquals('SAHAN', $model->first_name);
	}

	public function testEntityPath()
	{
		$model = new SampleModel;
		$this->assertEquals($model->getEntityPath(), 'samplemodels');
	}

	public function testQuery()
	{
		Resource::register('Foo');
		$query = Foo\SampleModelConfigured::query();
		$this->assertAttributeEquals('samplemodelconfigureds', 'path', $query);
		$this->assertAttributeEquals('Foo\\SampleModelConfigured', 'model', $query);
	}

	//check request object of query
	public function testQueryRequest()
	{
		Resource::register('Foo');
		$query   = Foo\SampleModelConfigured::query();

		//methods
		$this->assertAttributeEquals('GET', 'method', $query->getRequest());

		$query->setMethod('PUT');
		$this->assertAttributeEquals('PUT', 'method', $query->getRequest());

		//params
		$query->where('limit', 12)->where('email', '<EMAIL>');
		$this->assertAttributeEquals(array('limit' => 12, 'email' => '<EMAIL>'), 'params', $query->getRequest());
	}

	public function testModelQuery()
	{
		Resource::register('Foo');
		$model = new Foo\SampleModelConfigured;
		$model->id = 2;
		$query = $model->getModelQuery();
		$this->assertAttributeEquals('samplemodelconfigureds/2', 'path', $query);
	}
}<commit_msg>test fix<commit_after><?php
use Resto\Common\Resource;

class ModelTest extends PHPUnit_Framework_TestCase
{
	public function testSetAttributeWithoutMutator()
	{
		$model = new SampleModel;

		$model->id         = 2;
		$model->first_name = 'Sahan';
		$model->last_name  = 'H';

		$this->assertAttributeEquals(array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H'), 'attributes', $model);
	}

	public function testFillRaw()
	{
		$data  = array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H');
		$model = new SampleModel;
		$model->fillRaw($data);

		$this->assertAttributeEquals($data, 'attributes', $model);
	}

	public function testFill()
	{
		$data  = array('id' => 2, 'first_name' => 'Sahan', 'last_name' => 'H');
		$model = new SampleModel;
		$model->fillRaw($data);

		$this->assertAttributeEquals($data, 'attributes', $model);
	}

	public function testGetSetAttributeWithMutator()
	{
		$model = new Foo\SampleModelConfigured;
		$model->first_name = 'SAHAN';

		$this->assertAttributeEquals(array('first_name' => 'sahan'), 'attributes', $model);
		$this->assertEquals('SAHAN', $model->first_name);
	}

	public function testEntityPath()
	{
		$model = new SampleModel;
		$this->assertEquals($model->getEntityPath(), 'samplemodels');
	}

	public function testQuery()
	{
		Resource::register('Foo');
		$query = Foo\SampleModelConfigured::query();
		$this->assertAttributeEquals('samplemodelconfigureds', 'path', $query);
		$this->assertAttributeEquals('Foo\\SampleModelConfigured', 'model', $query);
	}

	//check request object of query
	public function testQueryRequest()
	{
		Resource::register('Foo');
		$query   = Foo\SampleModelConfigured::query();

		//methods
		$this->assertAttributeEquals('GET', 'method', $query->getRequest());

		$query->setMethod('PUT');
		$this->assertAttributeEquals('PUT', 'method', $query->getRequest());

		//params
		$query->where('limit', 12)->where('email', '<EMAIL>');
		$this->assertAttributeEquals(array('limit' => 12, 'email' => '<EMAIL>'), 'params', $query);
	}

	public function testModelQuery()
	{
		Resource::register('Foo');
		$model = new Foo\SampleModelConfigured;
		$model->id = 2;
		$query = $model->getModelQuery();
		$this->assertAttributeEquals('samplemodelconfigureds/2', 'path', $query);
	}
}
{'fraction_non_alphanumeric': 0.19185918591859186, 'fraction_numerical': 0.0044004400440044, 'mean_word_length': 5.411847672778562, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '487804', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1485, 'n_words': 277}