Omda
4 days ago

my testing taking too much time to pass

Posted 4 days ago by Omda

its working fine but its take a wile to run once function... take about 1.23 minuts.

this phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>

        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="MAIL_DRIVER" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="DB_CONNECTION" value="A_testing"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>

this .env

APP_NAME=Ali
APP_ENV=testing
APP_KEY=base64:4pMDQn44sFpSQW64I4TswIv5mV4l9Ck0UM0Om4aRQm0=
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://localhost
# DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306


DB_CONNECTION=sqlite
DB_DATABASE=database.sqlite
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=pusher
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

this database connection

 'connections' => [

        'atroha_testing' => [
            'driver' => 'sqlite',
            'database' => env('DB_DATABASE', storage_path("database.sqlite")),
            'prefix' => '',
        ],

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
        ],

        'A_testing' => [
            'driver' => 'mysql',
            'host' => env('DB_TEST_HOST', 'localhost'),
            'port' => env('DB_TEST_PORT', '3306'),
            'database' => env('DB_TEST_DATABASE', 'database.sqlite'),
            'username' => env('DB_TEST_USERNAME', 'root'),
            'password' => env('DB_TEST_PASSWORD', ''),
            'unix_socket' => env('DB_TEST_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
]

Please sign in or create an account to participate in this conversation.