PHP code example of boundwize / pyrameter

1. Go to this page and download the library: Download boundwize/pyrameter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

boundwize / pyrameter example snippets


return PyrameterConfig::defaults()
    ->usesClass(App\Search\ExternalSearch::class, TestKind::Integration);

return PyrameterConfig::create()
    ->usesClass(PDO::class, TestKind::Integration)
    ->targetShape(
        unit: ['min' => 80],
        integration: ['max' => 20],
    );



declare(strict_types=1);

use Boundwize\Pyrameter\Config\PyrameterConfig;
use Boundwize\Pyrameter\TestKind;

return PyrameterConfig::defaults()
    ->usesClass(App\Analyser\Analyser::class, TestKind::Integration)
    ->usesNamespace('App\Tests\Browser\\', TestKind::E2E)
    ->usesFunction('app_writes_to_disk', TestKind::Integration)
    ->targetShape(
        unit: ['min' => 75],
        functional: ['max' => 15],
        integration: ['max' => 7],
        e2e: ['max' => 2],
    )
    ->failOnViolation();

use App\Tests\Concerns\InteractsWithDatabase;
use App\Tests\Concerns\MakesHttpRequests;

return PyrameterConfig::create()
    ->usesClass(
        InteractsWithDatabase::class,
        TestKind::Integration,
        unless: [MakesHttpRequests::class],
    )
    ->usesClass(MakesHttpRequests::class, TestKind::Functional);

use App\Tests\Concerns\UsesVirtualFilesystem;

return PyrameterConfig::create()
    ->usesFunction(
        'file_put_contents',
        TestKind::Integration,
        unless: [UsesVirtualFilesystem::class],
    )
    ->usesClass(UsesVirtualFilesystem::class, TestKind::Functional);

return PyrameterConfig::defaults();

return PyrameterConfig::defaults()
    ->targetShape(
        unit: ['min' => 70],
        functional: ['max' => 20],
        integration: ['max' => 8],
        e2e: ['max' => 2],
    )
    ->failOnViolation();
xml
<extensions>
    <bootstrap class="Boundwize\Pyrameter\Extension">
        <parameter name="config" value="config/pyrameter.php"/>
    </bootstrap>
</extensions>