<commit_before><?php
// Usage: phpunit --verbose run.php

require '../Curl.class.php';
require 'helper.inc.php';


class CurlTest extends PHPUnit_Framework_TestCase {
    public function testExtensionLoaded() {
        $this->assertTrue(extension_loaded('curl'));
    }

    public function testUserAgent() {
        $test = new Test();
        $test->curl->setUserAgent(Curl::USER_AGENT);
        $this->assertTrue($test->server('GET', array(
            'test' => 'server',
            'key' => 'HTTP_USER_AGENT',
        )) === Curl::USER_AGENT);
    }

    public function testGet() {
        $test = new Test();
        $this->assertTrue($test->server('GET', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'GET');
    }

    public function testPostRequestMethod() {
        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'POST');
    }

    public function testPostData() {
        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'post',
            'key' => 'test',
        )) === 'post');
    }

    public function testPostFilePathUpload() {
        $tmp_filename = tempnam('/tmp', 'php-curl-class.');
        file_put_contents($tmp_filename, get_raw_image());

        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'post_file_path_upload',
            'key' => 'image',
            'image' => '@' . $tmp_filename,
        )) === 'image/png');

        unlink($tmp_filename);
    }

    public function testPut() {
        $test = new Test();
        $this->assertTrue($test->server('PUT', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'PUT');

        $test = new Test();
        $this->assertTrue($test->server('PUT', array(
            'test' => 'put',
            'key' => 'test',
        )) === 'put');
    }

    public function testDelete() {
        $test = new Test();
        $this->assertTrue($test->server('DELETE', array(
            'test' => 'server',<commit_msg>Separate PUT tests<commit_after><?php
// Usage: phpunit --verbose run.php

require '../Curl.class.php';
require 'helper.inc.php';


class CurlTest extends PHPUnit_Framework_TestCase {
    public function testExtensionLoaded() {
        $this->assertTrue(extension_loaded('curl'));
    }

    public function testUserAgent() {
        $test = new Test();
        $test->curl->setUserAgent(Curl::USER_AGENT);
        $this->assertTrue($test->server('GET', array(
            'test' => 'server',
            'key' => 'HTTP_USER_AGENT',
        )) === Curl::USER_AGENT);
    }

    public function testGet() {
        $test = new Test();
        $this->assertTrue($test->server('GET', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'GET');
    }

    public function testPostRequestMethod() {
        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'POST');
    }

    public function testPostData() {
        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'post',
            'key' => 'test',
        )) === 'post');
    }

    public function testPostFilePathUpload() {
        $tmp_filename = tempnam('/tmp', 'php-curl-class.');
        file_put_contents($tmp_filename, get_raw_image());

        $test = new Test();
        $this->assertTrue($test->server('POST', array(
            'test' => 'post_file_path_upload',
            'key' => 'image',
            'image' => '@' . $tmp_filename,
        )) === 'image/png');

        unlink($tmp_filename);
    }

    public function testPutRequestMethod() {
        $test = new Test();
        $this->assertTrue($test->server('PUT', array(
            'test' => 'server',
            'key' => 'REQUEST_METHOD',
        )) === 'PUT');
    }

    public function testPutData() {
        $test = new Test();
        $this->assertTrue($test->server('PUT', array(
            'test' => 'put',
            'key' => 'test',
        )) === 'put');
    }

    public function testDelete() {
        $test = new Test();
        $this->assertTrue($test->server('DELETE', array(
            'test' => 'server',
{'fraction_non_alphanumeric': 0.18794964028776978, 'fraction_numerical': 0.0, 'mean_word_length': 2.111188811188811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, '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': '4687921', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1300, 'n_words': 252}