<commit_before><?php
declare(strict_types=1);

/**
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 * @link          https://cakephp.org CakePHP(tm) Project
 * @since         3.0.0
 * @license       https://opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Test\TestCase;

use Cake\Datasource\ConnectionManager;
use Cake\TestSuite\TestSuite;
use PHPUnit\Framework\TestResult;

/**
 * All tests related to database
 */
class DatabaseSuite extends TestSuite
{
    /**
     * Returns a suite containing all tests requiring a database connection,
     * tests are decorated so that they are run once with automatic
     *
     * @return static
     */
    public static function suite()
    {
        $suite = new static('Database related tests');
        $suite->addTestFile(__DIR__ . DS . 'Database' . DS . 'ConnectionTest.php');
        $suite->addTestDirectoryRecursive(__DIR__ . DS . 'Database');
        $suite->addTestDirectoryRecursive(__DIR__ . DS . 'ORM');

        return $suite;
    }

    /**
     * @param bool $preferCache
     * @return int
     */
    public function count($preferCache = false): int
    {
        return parent::count($preferCache) * 2;
    }

    /**
     * Runs the tests and collects their result in a TestResult.
     *
     * @param \PHPUnit\Framework\TestResult $result
     * @return \PHPUnit\Framework\TestResult<commit_msg>No need to add ConnectionTest manually<commit_after><?php
declare(strict_types=1);

/**
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 * @link          https://cakephp.org CakePHP(tm) Project
 * @since         3.0.0
 * @license       https://opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\Test\TestCase;

use Cake\Datasource\ConnectionManager;
use Cake\TestSuite\TestSuite;
use PHPUnit\Framework\TestResult;

/**
 * All tests related to database
 */
class DatabaseSuite extends TestSuite
{
    /**
     * Returns a suite containing all tests requiring a database connection,
     * tests are decorated so that they are run once with automatic
     *
     * @return static
     */
    public static function suite()
    {
        $suite = new static('Database related tests');
        $suite->addTestDirectoryRecursive(__DIR__ . DS . 'Database');
        $suite->addTestDirectoryRecursive(__DIR__ . DS . 'ORM');

        return $suite;
    }

    /**
     * @param bool $preferCache
     * @return int
     */
    public function count($preferCache = false): int
    {
        return parent::count($preferCache) * 2;
    }

    /**
     * Runs the tests and collects their result in a TestResult.
     *
     * @param \PHPUnit\Framework\TestResult $result
     * @return \PHPUnit\Framework\TestResult
{'fraction_non_alphanumeric': 0.10930704552044071, 'fraction_numerical': 0.0028993911278631487, 'mean_word_length': 2.9518900343642613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3376470', 'n_tokens_mistral': 979, 'n_tokens_neox': 940, 'n_words': 291}