<commit_before><?php

class Functional_ControllerTest extends TestCase {

	public function test_containersGet_host()
	{
		$this->seed();

		$response = $this->call(
			'GET',
			'/v1/containers',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = []
		);

		$data = $response->getData(true);

		$this->assertTrue($response->isOk());
		$this->assertCount(1, $data['data']);
	}

	public function test_containersGet_host_byId()
	{
		$this->seed();

		parent::$factoryMuffin->create('App\Models\Container');

		$response = $this->call(
			'GET',
			'/v1/containers/98263476',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = []
		);

		$data = $response->getData(true);

		$this->assertTrue($response->isOk());
		$this->assertCount(1, $data['data']);
	}

	public function test_host_containersPatch()
	{
		$this->seed();

		$response = $this->call(
			'PUT',
			'/v1/containers/98263476',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = [
				'CONTENT_TYPE' => 'application/json',
				'ACCEPT' => 'application/json',
			],
			'{"data":{"type":"container","id":"98263476","cid":"abcdef"}}'
		);

		$this->assertTrue($response->getStatusCode() === 204);

		$data = $response->getData(true);

		$this->assertSame("98263476", $data['data']['id']);
		$this->assertSame("abcdef", $data['data']['cid']);
	}


}<commit_msg>tests.functional.ControllerTest: expect a 200 OK on a model put w/ changes<commit_after><?php

class Functional_ControllerTest extends TestCase {

	public function test_containersGet_host()
	{
		$this->seed();

		$response = $this->call(
			'GET',
			'/v1/containers',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = []
		);

		$data = $response->getData(true);

		$this->assertTrue($response->isOk());
		$this->assertCount(1, $data['data']);
	}

	public function test_containersGet_host_byId()
	{
		$this->seed();

		parent::$factoryMuffin->create('App\Models\Container');

		$response = $this->call(
			'GET',
			'/v1/containers/98263476',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = []
		);

		$data = $response->getData(true);

		$this->assertTrue($response->isOk());
		$this->assertCount(1, $data['data']);
	}

	public function test_host_containersPatch()
	{
		$this->seed();

		$response = $this->call(
			'PUT',
			'/v1/containers/98263476',
			$paramaters = [],
			$cookies = [],
			$files = [],
			$server = [
				'CONTENT_TYPE' => 'application/json',
				'ACCEPT' => 'application/json',
			],
			'{"data":{"type":"container","id":"98263476","cid":"abcdef"}}'
		);

		$this->assertTrue($response->isOk());

		$data = $response->getData(true);

		$this->assertSame("98263476", $data['data']['id']);
		$this->assertSame("abcdef", $data['data']['cid']);
	}


}
{'fraction_non_alphanumeric': 0.23018731988472624, 'fraction_numerical': 0.02881844380403458, 'mean_word_length': 3.9412811387900355, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 47, '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': '2871595', 'n_tokens_mistral': 1192, 'n_tokens_neox': 998, 'n_words': 139}