<commit_before><?php
/**
 *
 * @package libfajr
 * @subpackage Tests
 * @author <NAME> <<EMAIL>>
 */

/**
 * @ignore
 */
require_once 'test_include.php';

use fajr\libfajr\connection\HttpToSimpleConnectionAdapter;
/**
 * @ignore
 */
class HttpToSimpleConnectionAdapterTest extends PHPUnit_Framework_TestCase
{
  private function newConnection() {
    return $this->getMock('fajr\libfajr\connection\HttpConnection',
                          array('get', 'post', 'addCookie', 'clearCookies'));
  }

  public function testRequest()
  {
    $mockConnection = $this->newConnection();
    $adapter =
        new HttpToSimpleConnectionAdapter($mockConnection, '/tmp');

    $mockConnection->expects($this->once())
                   ->method('get')
                   ->will($this->returnValue('get'));

    $mockConnection->expects($this->once())
                   ->method('post')
                   ->will($this->returnValue('post'));

    $response = $adapter->request(new NullTrace, 'fmph.uniba.sk');
    $this->assertEquals('get', $reponse);

    $response = $adapter->request(new NullTrace, 'fmph.uniba.sk', array());
    $this->assertEquals('post', $reponse);
  }
}

<commit_msg>Fix testu.<commit_after><?php
/**
 *
 * @package libfajr
 * @subpackage Tests
 * @author <NAME> <<EMAIL>>
 */

/**
 * @ignore
 */
require_once 'test_include.php';

use fajr\libfajr\connection\HttpToSimpleConnectionAdapter;
use fajr\libfajr\NullTrace;
/**
 * @ignore
 */
class HttpToSimpleConnectionAdapterTest extends PHPUnit_Framework_TestCase
{
  private function newConnection() {
    return $this->getMock('fajr\libfajr\connection\HttpConnection',
                          array('get', 'post', 'addCookie', 'clearCookies'));
  }

  public function testRequest()
  {
    $mockConnection = $this->newConnection();
    $adapter =
        new HttpToSimpleConnectionAdapter($mockConnection, '/tmp');

    $mockConnection->expects($this->once())
                   ->method('get')
                   ->will($this->returnValue('get'));

    $mockConnection->expects($this->once())
                   ->method('post')
                   ->will($this->returnValue('post'));

    $response = $adapter->request(new NullTrace, 'fmph.uniba.sk');
    $this->assertEquals('get', $response);

    $response = $adapter->request(new NullTrace, 'fmph.uniba.sk', array());
    $this->assertEquals('post', $response);
  }
}


{'fraction_non_alphanumeric': 0.17147636971978253, 'fraction_numerical': 0.0, 'mean_word_length': 3.16, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 41, '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': '6199174', 'n_tokens_mistral': 725, 'n_tokens_neox': 705, 'n_words': 113}