<commit_before><?php

use Artax\Client,
    Artax\Request;

/**
 * These tests will not add any test coverage because the Aerys server executes in a separate
 * process. Instead, this code tests integration of the server as a whole by making requests over
 * the TCP stack to the server process and lets us know if the response we received differs from
 * what was expected.
 * 
 * Note also that the server process's STDERR is piped to the test process's STDERR stream. This
 * allows us to see exactly what went wrong in the event of runtime errors triggered by the server.
 */
class ServerIntegrationTest extends PHPUnit_Framework_TestCase {
    
    private static $serverProcess;
    private static $serverPipes;
    
    private $isServerDead = FALSE;
    
    static function setUpBeforeClass() {
        $serverPath = FIXTURE_DIR . '/integration_server.php';
        $cmd = self::generatePhpBinaryCmd($serverPath);
        $descriptors = [
           2 => ["pipe", STDERR, "w"] // pipe STDERR to this process's STDERR
        ];
        
        self::$serverProcess = proc_open($cmd, $descriptors, self::$serverPipes);
        
        // If we don't give the server process time to boot up and bind its socket we risk getting
        // a socket exception when we try to connect in our tests.
        usleep(100000);
    }
    <commit_msg>minor documentation update<commit_after><?php

use Artax\Client,
    Artax\Request;

/**
 * These tests will not add any test coverage because the Aerys server executes in a separate
 * process. Instead, this code tests integration of the server as a whole by making requests over
 * the TCP stack to the server process and lets us know if the response we received differs from
 * what was expected.
 * 
 * Note also that the server process's STDERR is piped to the test process's STDERR stream. This
 * allows us to see exactly what went wrong in the event of runtime errors triggered by the server.
 */
class ServerIntegrationTest extends PHPUnit_Framework_TestCase {
    
    private static $serverProcess;
    private static $serverPipes;
    
    private $isServerDead = FALSE;
    
    static function setUpBeforeClass() {
        $serverPath = FIXTURE_DIR . '/integration_server.php';
        $cmd = self::generatePhpBinaryCmd($serverPath);
        $descriptors = [
           2 => ["pipe", STDERR, "w"] // pipe STDERR to this process's STDERR
        ];
        
        self::$serverProcess = proc_open($cmd, $descriptors, self::$serverPipes);
        
        // If we don't give the server process a moment to boot up and bind its socket we risk
        // getting a socket exception when we try to connect in our tests.
        usleep(100000);
    }
    
{'fraction_non_alphanumeric': 0.0714548802946593, 'fraction_numerical': 0.005156537753222836, 'mean_word_length': 2.9022988505747125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6428209', 'n_tokens_mistral': 727, 'n_tokens_neox': 707, 'n_words': 317}