<commit_before><?php
/**
 * @author @jayS-de <<EMAIL>>
 */

namespace Commercetools\Core;

use Commercetools\Core\Model\Common\Context;
use Symfony\Component\Yaml\Yaml;

class ApiTestCase extends \PHPUnit_Framework_TestCase
{
    private static $testRun;
    protected $client;

    protected $cleanupRequests = [];

    public function getTestRun()
    {
        if (is_null(self::$testRun)) {
            self::$testRun = md5(microtime());
        }

        return self::$testRun;
    }

    public function tearDown()
    {
        $this->cleanup();
    }

    /**
     * @return \Commercetools\Core\Client
     */
    public function getClient()
    {
        if (is_null($this->client)) {
            $context = Context::of()->setGraceful(false)->setLanguages(['en'])->setLocale('en_US');
            if (file_exists(__DIR__ . '/../../docroot/myapp.yml')) {
                $appConfig = Yaml::parse(file_get_contents(__DIR__ . '/../../docroot/myapp.yml'));
                $config = Config::fromArray($appConfig['parameters']);
            } else {
                $config = Config::fromArray([
                    'client_id' => $_SERVER['COMMERCETOOLS_CLIENT_ID'],
                    'client_secret' => $_SERVER['COMMERCETOOLS_CLIENT_SECRET'],
                    'project' => $_SERVER['COMMERCETOOLS_PROJECT'],
                    'context' => $context
                ]);
            }
            $verifySSL = getenv('PHP_SDK_IT_SSL_VERIFY');
            $verify = true;
            if ($verifySSL === 'false') {
                $verify = false;
            }
            var_dump($verify);
            $this->client = Client::ofConfig($config);
            $this->client->getOauthManager()->getHttpClient([$verify]);
            $this->client->getHttpClient([$verify]);
        }

        return $this->client;
    }

    protected function cleanup()
    {
        if (count($this->cleanupRequests) > 0) {
            foreach ($this->cleanupRequests as $request) {
                $this->getClient()->addBatchRequest($request);
            }
            $this->getClient()->executeBatch();<commit_msg>chore(Teamcity): fix insecure ssl certificate<commit_after><?php
/**
 * @author @jayS-de <<EMAIL>>
 */

namespace Commercetools\Core;

use Commercetools\Core\Model\Common\Context;
use Symfony\Component\Yaml\Yaml;

class ApiTestCase extends \PHPUnit_Framework_TestCase
{
    private static $testRun;
    protected $client;

    protected $cleanupRequests = [];

    public function getTestRun()
    {
        if (is_null(self::$testRun)) {
            self::$testRun = md5(microtime());
        }

        return self::$testRun;
    }

    public function tearDown()
    {
        $this->cleanup();
    }

    /**
     * @return \Commercetools\Core\Client
     */
    public function getClient()
    {
        if (is_null($this->client)) {
            $context = Context::of()->setGraceful(false)->setLanguages(['en'])->setLocale('en_US');
            if (file_exists(__DIR__ . '/../../docroot/myapp.yml')) {
                $appConfig = Yaml::parse(file_get_contents(__DIR__ . '/../../docroot/myapp.yml'));
                $config = Config::fromArray($appConfig['parameters']);
            } else {
                $config = Config::fromArray([
                    'client_id' => $_SERVER['COMMERCETOOLS_CLIENT_ID'],
                    'client_secret' => $_SERVER['COMMERCETOOLS_CLIENT_SECRET'],
                    'project' => $_SERVER['COMMERCETOOLS_PROJECT'],
                    'context' => $context
                ]);
            }
            $verifySSL = getenv('PHP_SDK_IT_SSL_VERIFY');
            $verify = true;
            if ($verifySSL === 'false') {
                $verify = false;
            }
            $this->client = Client::ofConfig($config);
            $this->client->getOauthManager()->getHttpClient(['verify' => $verify]);
            $this->client->getHttpClient(['verify' => $verify]);
        }

        return $this->client;
    }

    protected function cleanup()
    {
        if (count($this->cleanupRequests) > 0) {
            foreach ($this->cleanupRequests as $request) {
                $this->getClient()->addBatchRequest($request);
            }
            $this->getClient()->executeBatch();
{'fraction_non_alphanumeric': 0.15636021631789326, 'fraction_numerical': 0.0009405125793557489, 'mean_word_length': 2.0256045519203414, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 55, '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': '4533853', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1214, 'n_words': 184}