<commit_before><?php
namespace eComCharge;

class GatewayTransportExceptionTest extends TestCase {

  function setUp() {
    $this->_apiBase = Settings::$apiBase;
    Settings::$apiBase = 'https://thedomaindoesntexist.ecomcharge.com';
  }

  function tearDown() {
    Settings::$apiBase = $this->_apiBase;
  }

  public function test_networkIssuesHandledCorrectly() {
    $auth = $this->getTestObject();

    $amount = rand(0,10000) / 100;

    $auth->money->setAmount($amount);
    $cents = $auth->money->getCents();

    $response = $auth->submit();

    $this->assertTrue($response->isError());
    $this->assertPattern('|Could not resolve host: thedomaindoesntexist.ecomcharge.com|', $response->getMessage());

  }

  protected function getTestObject($threed = false) {

    $transaction = $this->getTestObjectInstance($threed);

    $transaction->money->setAmount(12.33);
    $transaction->money->setCurrency('EUR');
    $transaction->setDescription('test');
    $transaction->setTrackingId('my_custom_variable');

    $transaction->card->setCardNumber('4200000000000000');
    $transaction->card->setCardHolder('<NAME>');
    $transaction->card->setCardExpMonth(1);
    $transaction->card->setCardExpYear(2030);
    $transaction->card->setCardCvc('123');

    $transaction->customer->setFirstName('John');
    $transaction->customer->setLastName('Doe');
    $transaction->customer->setCountry('LV');
    $transaction->customer->setAddress('Demo str 12');
    $transaction->customer->setCity('Riga');
    $transaction->customer->setZip('LV-1082');
    $transaction->customer->setIp('127.0.0.1');
    $transaction->customer->setEmail('<EMAIL>');

    return $transaction;
  }
<commit_msg>update assert text in test<commit_after><?php
namespace eComCharge;

class GatewayTransportExceptionTest extends TestCase {

  function setUp() {
    $this->_apiBase = Settings::$apiBase;
    Settings::$apiBase = 'https://thedomaindoesntexist.ecomcharge.com';
  }

  function tearDown() {
    Settings::$apiBase = $this->_apiBase;
  }

  public function test_networkIssuesHandledCorrectly() {
    $auth = $this->getTestObject();

    $amount = rand(0,10000) / 100;

    $auth->money->setAmount($amount);
    $cents = $auth->money->getCents();

    $response = $auth->submit();

    $this->assertTrue($response->isError());
    $this->assertPattern("|resolve host: thedomaindoesntexist.ecomcharge.com|", $response->getMessage());

  }

  protected function getTestObject($threed = false) {

    $transaction = $this->getTestObjectInstance($threed);

    $transaction->money->setAmount(12.33);
    $transaction->money->setCurrency('EUR');
    $transaction->setDescription('test');
    $transaction->setTrackingId('my_custom_variable');

    $transaction->card->setCardNumber('4200000000000000');
    $transaction->card->setCardHolder('<NAME>');
    $transaction->card->setCardExpMonth(1);
    $transaction->card->setCardExpYear(2030);
    $transaction->card->setCardCvc('123');

    $transaction->customer->setFirstName('John');
    $transaction->customer->setLastName('Doe');
    $transaction->customer->setCountry('LV');
    $transaction->customer->setAddress('Demo str 12');
    $transaction->customer->setCity('Riga');
    $transaction->customer->setZip('LV-1082');
    $transaction->customer->setIp('127.0.0.1');
    $transaction->customer->setEmail('<EMAIL>');

    return $transaction;
  }

{'fraction_non_alphanumeric': 0.18010038382049012, 'fraction_numerical': 0.02893416002361972, 'mean_word_length': 4.8717504332755635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 97, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 2, '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': '4428022', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1014, 'n_words': 130}